When logging into Log4Net, it is very easy to put the class that called the log into the log file. In the past, I have found that it is very easy to track code and view a stream through classes. In Log4Net, I use the% logger property in the conversion template, for example:
<conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
And this gives me the result I want:
2008-09-19 15:40:26,906 [3132] ERROR <b>Log4NetTechDemo.Tester</b> [(null)] - Failed method
On output, you can see that the class that the log called is Log4NetTechDemo.Tester, so I can easily trace the error back to this class.
In the Appliance Logging block, I cannot figure out how to do this with a simple log call. Does anyone know how to do this? If so, then an example or steps for this would be very helpful.
source
share