I have been told to add “logging” to my code using log4net, the problem is no one can travel in time and see what real world problems the logging will need to be used to solve.<
One thing to bear in mind is that whilst your configuration will handle logging at different levels, you may be causing heavy overhead in your log calls. For example:
// some kind of loop
// do some operations
Logger.LogDebug(myObject.GetXmlRepresentation());
// end loop
This will obviously only log the object if you have a logger listening to DEBUG logs, however the call to build the XML object will run regardless of your logging level and could cause some considerable slowdowns.
The correct solution would be:
// some kind of loop
// do some operations
if (Logger.IsDebug)
{
Logger.LogDebug(myObject.GetXmlRepresentation());
}
// end loop