0

I want to log errors with System.Diagnostics.TraceSource and wonder which Listener I could use and how to configure it so that it logs to Log Files in a specified directory. A new log file should be created when the log reaches a specific size.

Is there an exisiting listener that does this? Or something that comes close?

I know logging to Windows Event Log is best practice, but I cannot easily access the log on the server, so using files I can download through FTP seem to be the best solution.

magnattic
  • 12,638
  • 13
  • 62
  • 115

1 Answers1

0

What about using Log4NET, free and solid, it has all possible kind of appenders and you control everything from the app.config or web.config

Davide Piras
  • 43,984
  • 10
  • 98
  • 147
  • 1
    well, while this might be true it does not answer the question I posted. ;) I just want to switch with TraceSource from Windows Event Log to a Log File Listener. – magnattic Jan 19 '11 at 21:18
  • 1
    Ok, so you want to use the default .NET trace and having a TraceListener which redirects to a log file, what about the System.Diagnostics.TextWriterTraceListener ? see here: http://msdn.microsoft.com/en-us/library/system.diagnostics.textwritertracelistener.aspx – Davide Piras Jan 19 '11 at 21:47