Hi,
I'm writing an audit log utility for our product using log4net. There are custom fields need to be output. I used MDC to set those fields every time before calling ILog.Debut() (or Error(), Fatal()...). The following is the sample code
// Set output fields
log4net.MDC.Set("theUser", strUser);
log4net.MDC.Set("sessionid", strSession);
log4net.MDC.Set("machine", strClientMachine);
//Output data
log.Warn(message);
Because during the same session (thread) the above data is the same. I'm wondering if there is threadsafe storage in log4net so that the setting output fields block is only called once. The audit log utility is used enormously in our product. Therefore performance is very critical.
I'd appreciate it if any one can show me a better solution or point me to related documents. By the way, I'm using log4net 1.2 beta8. We can upgrade it if needed.
Thank you in advance.
Ping Xie
CACI
4831 Walden Lane
Lanham, MD 20706
[EMAIL PROTECTED]
(301) 306-8200 - Main
(301) 306-2829 - Direct
- AW: Log4Net Viewer Eduard Ralph
- Re: Log4Net Viewer Shaily Goel
- RE: Log4Net Viewer admin
- RE: Log4Net Viewer Alisdair Little
- Re: Log4Net Viewer Hollywood
- RE: Log4Net Viewer admin
- RE: Log4Net Viewer Shaily Goel
- Log4Net Viewer Howard Weisberg
- RE: Log4Net Viewer admin
- Re: Log4Net Viewer Ron Grabowski
- Log4net threadsafe storage Ping Xie
- Re: Log4net threadsafe storage Ron Grabowski
- RE: Log4Net Viewer Ron Grabowski
- RE: Log4Net Viewer admin
- RE: Log4Net Viewer Nicko Cadell
- RE: Log4Net Viewer Ron Grabowski
- RE: Log4Net Viewer Göran Roseen
- Re: Log4Net Viewer Thibaut Barrère
- Detecting Internal Errors Göran Roseen
- Log4Net Viewer Richard Thurston
- RE: Log4Net Viewer Göran Roseen
