We are working on logging into our applications using log4net. We would like to receive certain information automatically with each call. The code that calls log.Info or log.Warn should call them normally, without specifying this information.
I am looking for a way to create something that we can connect to log4net. Something between ILog applications is used to register and add, so that we can somehow put this information in a log message. Either in ThreadContext or in LogEventInfo.
The information we are about to capture is related to asp.net; Request URL, user agent, etc. There is also information from the application .config file that we want to include (application identifier).
I want to get between normal ILog.Info and appender so that this information is also automatically included for third-party libraries that also use log4net (Nhibernate, NServiceBus, etc.).
Any suggestions on where to expand will be?
thank
source
share