I'm using system.diagnostic
to log all the errors to a log file
Web.Config:
<system.diagnostics>
<trace autoflush="true" indentsize="4">
<listeners>
<add name="MyListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="MyListenerLog.txt" />
<remove name="Default" />
</listeners>
</trace>
</system.diagnostics>
Code:
private static void AddToMyListner(string message)
{
try
{
System.Diagnostics.Trace.WriteLine("Text: " +message + "," + DateTime.UtcNow);
System.Diagnostics.Trace.Close();
}
catch (Exception ex)
{
throw ex;
}
}
In the Log file the first log i got was
no configuration section <common/logging> found - suppressing logging output
This log is printed only once i.e. only when I create a new log file. I'm not using Common.Logging
so i was wondering what is causing this issue.