I understand it's not your exact requirement, but what about including
the user name in each message logged, but pushing it into the NDC? We
have a similar requirement to include the client name in our
application, and we use a single log file (per day) but every request
starts with a NDC.Push(ClientID) step. Then it's a trivial job to grep
the log file for the client name. Likewise, when you need to see the log
file for JoeUser you could just grep for JoeUser. 

 

If you need them maintained then you could just split the files after
the fact by user name. 

 

-Walden

 


-- 
Walden H Leverich III
Tech Software & 

BEC - IRBManager
(516) 627-3800 x3051
wald...@techsoftinc.com
http://www.TechSoftInc.com <http://www.techsoftinc.com/> 
http://www.IRBManager.com <http://www.irbmanager.com/> 


Quiquid latine dictum sit altum viditur.
(Whatever is said in Latin seems profound.)

 

From: Shekar [mailto:shivaraj...@gmail.com] 
Sent: Friday, November 27, 2009 11:47 PM
To: log4net-user@logging.apache.org
Subject: webapplication logging - one log file per user

 

Hi,

 

Please help me with this query in using log4net.

 

I am using log4net in mhy we application. I am facing issues in
configuring log4net to log errors at user level. 

 

That is, If user X logs in, I like to create file name X and all error
for user X should be written in X.log. Siilarly if Y user logs in the
log file should be in name of Y.log and the most important point to note
is, they could log in concurrently.

 

I tried the luck by creating log files whose name would be framed
dynamically as soon as the user logs in. But issue here, if they are not
using the application at the same time, the log files are creeated with
correct name and writing as expected, but if both users have active
sessions, log file is created only for user who FIRST logged in and
error of second user has been recorded in log file that is created for
FIRST user.

 

Please help me in this.

 

Thanks much.

 

Reply via email to