Monday, July 30, 2012

Log4Net does not log in Release Mode

A weird bug was bugging (sorry) me recently. Log4Net works perfectly under Debug mode. But when it comes to release, it was not logging anything at all.
After a lot of hair pulling and gritting of teeth, a solution was found.

Simply call the logger itself as soon as possible.
So in the case of Asp.Net, this means that under Application_Start, you need to do a call like logger.Info("Starting");

1 comment:

Anonymous said...

This was helpful, thanks!