You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Saif Khaja <ks...@hotmail.com> on 2002/07/01 20:50:58 UTC

creating log file for each user

We have our application running on Websphere with log4j 1.1.3. It involves 
some complicated calculations for each transaction that user performs. Every 
thing goes on fine except that since there is just one common log file, 
these calculations log statments get intermingled among different users 
making it hard to debug an issue.

What I was trying to achieve is a way to create a log file for each user. 
This way, all complex calculations log statements will be separate for each 
user making it easier to debug if we have to.

I did spend quite a while going thru the archives on this issue but couldnt 
find one. So if this has been discussed already, I apologize for it.

Among the existing appenders/patterns in log4j, I could use the following to 
achieve the same thing:

1. jdbcappender: send the log statements to the database and can query them 
on each user.
This would however take too much database space.

2. jmsappender: I havent really looked closely at this one yet. But I know I 
could receive the log statements and write some custom code to put each log 
statement in a separate file based on the user who initiated it.

3. xmllayout: Generate xml version of the log file and write xsl to display 
the log file for requested user.

I was wondering if there is a quicker/cleaner way or am I just complicating 
things for myself to achieve this. And if there is none, is there something 
that is planned in near future.

Thanks,
Saif.


_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: creating log file for each user

Posted by Thomas Muller <tt...@online.no>.
NDC and MDC are "lightweith" variants of what you want to achieve; that is,
you can assign a unique "id" to each log event (e.g. a username), and
filter/sort based on this id when perusing the log.

Another alternative is to create/get/restore an Appender programmatically
for each individual user.

Hope this helps.

--

Thomas


 | -----Original Message-----
 | From: Saif Khaja [mailto:ksaif25@hotmail.com]
 | Sent: 01 July 2002 19:51
 | To: log4j-user@jakarta.apache.org
 | Subject: creating log file for each user
 |
 |
 | We have our application running on Websphere with log4j 1.1.3.
 | It involves
 | some complicated calculations for each transaction that user
 | performs. Every
 | thing goes on fine except that since there is just one common log file,
 | these calculations log statments get intermingled among different users
 | making it hard to debug an issue.
 |
 | What I was trying to achieve is a way to create a log file for
 | each user.
 | This way, all complex calculations log statements will be
 | separate for each
 | user making it easier to debug if we have to.
 |
 | I did spend quite a while going thru the archives on this issue
 | but couldnt
 | find one. So if this has been discussed already, I apologize for it.
 |
 | Among the existing appenders/patterns in log4j, I could use the
 | following to
 | achieve the same thing:
 |
 | 1. jdbcappender: send the log statements to the database and can
 | query them
 | on each user.
 | This would however take too much database space.
 |
 | 2. jmsappender: I havent really looked closely at this one yet.
 | But I know I
 | could receive the log statements and write some custom code to
 | put each log
 | statement in a separate file based on the user who initiated it.
 |
 | 3. xmllayout: Generate xml version of the log file and write xsl
 | to display
 | the log file for requested user.
 |
 | I was wondering if there is a quicker/cleaner way or am I just
 | complicating
 | things for myself to achieve this. And if there is none, is
 | there something
 | that is planned in near future.
 |
 | Thanks,
 | Saif.
 |
 |
 | _________________________________________________________________
 | Send and receive Hotmail on your mobile device: http://mobile.msn.com
 |
 |
 | --
 | To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>




*************************************************************************
Copyright ERA Technology Ltd. 2002. (www.era.co.uk). All rights reserved. 
The information supplied in this email should be treated in confidence.
No liability whatsoever is accepted for any loss or damage 
suffered as a result of accessing this message or any attachments.

________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs SkyScan
service. For more information on a proactive anti-virus service working
around the clock, around the globe, visit http://www.messagelabs.com
________________________________________________________________________

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>