RE: webapplication logging - one log file per user

2009-11-30 Thread Walden H. Leverich
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.

 



Re: webapplication logging - one log file per user

2009-11-30 Thread Shekar
Well, Thanks to everyone for the suggestions.

At last I got what I wanted. Following were the steps I followed:

1. Set the file name dynamically using GlobalContext [you can ThreadContext
as well] property which the user who logged in.

2. Load the config file using XmlConfigurator.Configure(ConfigFile).

3. Now use GetLogger(type())

This working is perfectly as expected.
Thanks again.
Raj.

On Mon, Nov 30, 2009 at 8:36 PM, Walden H. Leverich wald...@techsoftinc.com
 wrote:

  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.





RE: webapplication logging - one log file per user

2009-11-30 Thread Matt Lund
Be careful about using the global context...  In a scenario where you
have two users logged in simultaneously wouldn't you have problems?

 

From: Shekar [mailto:shivaraj...@gmail.com] 
Sent: Monday, November 30, 2009 9:21 AM
To: Log4NET User
Subject: Re: webapplication logging - one log file per user

 

Well, Thanks to everyone for the suggestions.

 

At last I got what I wanted. Following were the steps I followed:

 

1. Set the file name dynamically using GlobalContext [you can
ThreadContext as well] property which the user who logged in.

 

2. Load the config file using XmlConfigurator.Configure(ConfigFile).

 

3. Now use GetLogger(type())

This working is perfectly as expected.

Thanks again.

Raj.

On Mon, Nov 30, 2009 at 8:36 PM, Walden H. Leverich
wald...@techsoftinc.com wrote:

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.

 

 



Re: webapplication logging - one log file per user

2009-11-30 Thread Shekar
No. It has passed my initial test ie., POC. Let me test it thoroughly after
integration and update you.

Regards,
Raj.




On Mon, Nov 30, 2009 at 11:04 PM, Matt Lund ml...@control4.com wrote:

  Be careful about using the global context…  In a scenario where you have
 two users logged in simultaneously wouldn’t you have problems?



 *From:* Shekar [mailto:shivaraj...@gmail.com]
 *Sent:* Monday, November 30, 2009 9:21 AM
 *To:* Log4NET User
 *Subject:* Re: webapplication logging - one log file per user



 Well, Thanks to everyone for the suggestions.



 At last I got what I wanted. Following were the steps I followed:



 1. Set the file name dynamically using GlobalContext [you can ThreadContext
 as well] property which the user who logged in.



 2. Load the config file using XmlConfigurator.Configure(ConfigFile).



 3. Now use GetLogger(type())

 This working is perfectly as expected.

 Thanks again.

 Raj.

 On Mon, Nov 30, 2009 at 8:36 PM, Walden H. Leverich 
 wald...@techsoftinc.com wrote:

 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.







RE: webapplication logging - one log file per user

2009-11-30 Thread Walden H. Leverich
Sounds to me like a race-condition in the making. Follow the timeline:

 

User1 Logs in

Set GlobalContext = User1

Configure

Log

 

All is good. But what about:

 

User1 Logs in

Set GlobalContext = User1

User2 Logs in

Set GlobalContext = User2

Configure (from first login)

Log something

Configure (from second login)

Log something else

 

I'll bet both log entries end up in the second file.

 

-Walden

 


-- 
Walden H Leverich III
Tech Software  

BEC - IRBManager
(516) 627-3800 x3051
wald...@techsoftinc.com mailto: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: Monday, November 30, 2009 11:21 AM
To: Log4NET User
Subject: Re: webapplication logging - one log file per user

 

Well, Thanks to everyone for the suggestions.

 

At last I got what I wanted. Following were the steps I followed:

 

1. Set the file name dynamically using GlobalContext [you can
ThreadContext as well] property which the user who logged in.

 

2. Load the config file using XmlConfigurator.Configure(ConfigFile).

 

3. Now use GetLogger(type())

This working is perfectly as expected.

Thanks again.

Raj.

On Mon, Nov 30, 2009 at 8:36 PM, Walden H. Leverich
wald...@techsoftinc.com wrote:

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.

 

 



Re: webapplication logging - one log file per user

2009-11-29 Thread Srinivas Repala
if I hv understood it correct, By using log thread context, we should capture 
each user in the application.

 A new appender can be added for each user to capture the log. 
Sent from my Verizon Wireless BlackBerry

-Original Message-
From: Shekar shivaraj...@gmail.com
Date: Sun, 29 Nov 2009 11:16:56 
To: Log4NET Userlog4net-user@logging.apache.org
Subject: Re: webapplication logging - one log file per user

No Karim,

My requirement is like that. We need to maintain user level logging rather
than at application level. Pls try to help me out. I am desperate.

Thanks,
Raj.

On Sat, Nov 28, 2009 at 11:41 PM, Karim Bourouba kar...@hotmail.com wrote:

 Hi Raj,

 surely there wouldnt be a new log created for each user
 interaction? Wouldnt it be better for you to just record each interaction on
 one log?




 --
 Date: Sat, 28 Nov 2009 19:03:24 +0530
 Subject: Re: webapplication logging - one log file per user

 From: shivaraj...@gmail.com
 To: log4net-user@logging.apache.org

 Thanks Karim.

 I don't have any other logging.

 There is only one type of logging - log all the errors per user in a log
 whose name would be the person who logged in. If 10 users are goign to use
 the application 10 seperate logs should be there.

 Help me out.

 Regards,
 Raj.

 On Sat, Nov 28, 2009 at 4:31 PM, Karim Bourouba kar...@hotmail.comwrote:

 Does your web app already store this information in a seperate log, or at a
 different level? If it does, it may be easy to create a new appender to get
 the information out of this source rather than shoehorning it all into
 log4net.




 --
 Date: Sat, 28 Nov 2009 10:16:44 +0530
 Subject: webapplication logging - one log file per user
 From: shivaraj...@gmail.com
 To: log4net-user@logging.apache.org


  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.


  --
 Use Hotmail to send and receive mail from your different email accounts. Find
 out how. http://clk.atdmt.com/UKM/go/186394592/direct/01/



  --
 New! Receive and respond to mail from other email accounts from within
 Hotmail Find out how. http://clk.atdmt.com/UKM/go/186394593/direct/01/




Re: webapplication logging - one log file per user

2009-11-28 Thread Shekar
Thanks Karim.

I don't have any other logging.

There is only one type of logging - log all the errors per user in a log
whose name would be the person who logged in. If 10 users are goign to use
the application 10 seperate logs should be there.

Help me out.

Regards,
Raj.

On Sat, Nov 28, 2009 at 4:31 PM, Karim Bourouba kar...@hotmail.com wrote:

 Does your web app already store this information in a seperate log, or at a
 different level? If it does, it may be easy to create a new appender to get
 the information out of this source rather than shoehorning it all into
 log4net.




 --
 Date: Sat, 28 Nov 2009 10:16:44 +0530
 Subject: webapplication logging - one log file per user
 From: shivaraj...@gmail.com
 To: log4net-user@logging.apache.org


  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.


  --
 Use Hotmail to send and receive mail from your different email accounts. Find
 out how. http://clk.atdmt.com/UKM/go/186394592/direct/01/



RE: webapplication logging - one log file per user

2009-11-28 Thread Karim Bourouba

Hi Raj,

 

surely there wouldnt be a new log created for each user interaction? Wouldnt it 
be better for you to just record each interaction on one log?


 




Date: Sat, 28 Nov 2009 19:03:24 +0530
Subject: Re: webapplication logging - one log file per user
From: shivaraj...@gmail.com
To: log4net-user@logging.apache.org


Thanks Karim.
 
I don't have any other logging. 
 
There is only one type of logging - log all the errors per user in a log whose 
name would be the person who logged in. If 10 users are goign to use the 
application 10 seperate logs should be there.
 
Help me out.
 
Regards,
Raj.


On Sat, Nov 28, 2009 at 4:31 PM, Karim Bourouba kar...@hotmail.com wrote:


Does your web app already store this information in a seperate log, or at a 
different level? If it does, it may be easy to create a new appender to get the 
information out of this source rather than shoehorning it all into log4net.



  


Date: Sat, 28 Nov 2009 10:16:44 +0530
Subject: webapplication logging - one log file per user
From: shivaraj...@gmail.com
To: log4net-user@logging.apache.org 






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.




Use Hotmail to send and receive mail from your different email accounts. Find 
out how.
  
_
Got more than one Hotmail account? Save time by linking them together
 http://clk.atdmt.com/UKM/go/186394591/direct/01/

Re: webapplication logging - one log file per user

2009-11-28 Thread Shekar
No Karim,

My requirement is like that. We need to maintain user level logging rather
than at application level. Pls try to help me out. I am desperate.

Thanks,
Raj.

On Sat, Nov 28, 2009 at 11:41 PM, Karim Bourouba kar...@hotmail.com wrote:

 Hi Raj,

 surely there wouldnt be a new log created for each user
 interaction? Wouldnt it be better for you to just record each interaction on
 one log?




 --
 Date: Sat, 28 Nov 2009 19:03:24 +0530
 Subject: Re: webapplication logging - one log file per user

 From: shivaraj...@gmail.com
 To: log4net-user@logging.apache.org

 Thanks Karim.

 I don't have any other logging.

 There is only one type of logging - log all the errors per user in a log
 whose name would be the person who logged in. If 10 users are goign to use
 the application 10 seperate logs should be there.

 Help me out.

 Regards,
 Raj.

 On Sat, Nov 28, 2009 at 4:31 PM, Karim Bourouba kar...@hotmail.comwrote:

 Does your web app already store this information in a seperate log, or at a
 different level? If it does, it may be easy to create a new appender to get
 the information out of this source rather than shoehorning it all into
 log4net.




 --
 Date: Sat, 28 Nov 2009 10:16:44 +0530
 Subject: webapplication logging - one log file per user
 From: shivaraj...@gmail.com
 To: log4net-user@logging.apache.org


  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.


  --
 Use Hotmail to send and receive mail from your different email accounts. Find
 out how. http://clk.atdmt.com/UKM/go/186394592/direct/01/



  --
 New! Receive and respond to mail from other email accounts from within
 Hotmail Find out how. http://clk.atdmt.com/UKM/go/186394593/direct/01/