log4net Configuration for console app

mxg picture mxg · Nov 16, 2009 · Viewed 15.1k times · Source

can anyone suggest how to configure the log4net for an console app?

Or at least how/where to catch the Application_Start event? (It seams that some calls are required at this moment)

Thanks in advance!

Answer

Ron Klein picture Ron Klein · Nov 18, 2009

Try writing

[assembly: log4net.Config.XmlConfigurator(Watch = true)]

in AssemblyInfo.cs

That's it!