AS SOON AS U LOGIN
set
log4net.MDC.Set("User", HttpContext.Current.User.Identity.Name)
In log4net.mdc you set all your custom fields and values it can pick up
from.
In your configuration file use
<conversionPattern value="%c %X{User} %X{Client} [%P{hostname}] %date
%-w [%Identity] [%thread] %-5level %logger [%property{NDC}] -
%message%newline" />
hope this helps.
Shiva Ganapatiraju
New York State
Office of Children & Family Services
Information Technology/SSOP Project
518.403.9056
[EMAIL PROTECTED]
http://ocfs.state.nyenet/admin/ofm/rsu
--------------------------------------------------------
This communication, together with any attachments hereto or links contained
herein, is for the sole use of the intended recipient(s) and may contain
information that is confidential, privileged, or legally protected, and as such
is not a public document. If you are not the intended recipient, you are
hereby notified that any review, disclosure, copying, dissemination,
distribution or use of this communication is STRICTLY PROHIBITED. If you have
received this communication in error, please notify the sender immediately by
return e-mail message and delete the original and all copies of the
communication, along with any attachments hereto or links herein, from your
system.
-----Original Message-----
From: Johnny [mailto:[EMAIL PROTECTED]
Sent: Friday, September 23, 2005 5:08 AM
To: 'Log4NET User'
Subject: how can i add my custom infomaition
Hi,
When I using log4net's AdoAppender,I have a problem, because the
log4net framework default provide
logger,logtime,logLevel,message,etc,but I want to adds extra information
like the username, department, etc.so what can I do? I don't know how to
implement it .can you help me ? thanks very much.