aspose file tools*
The moose likes Other Open Source Projects and the fly likes Log4j configuration help. Using different log files for different applications Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Log4j configuration help. Using different log files for different applications " Watch "Log4j configuration help. Using different log files for different applications " New topic
Author

Log4j configuration help. Using different log files for different applications

ketan joshi
Greenhorn

Joined: Sep 25, 2005
Posts: 3
I have a single log4j.jar and properties file...I have multiple applications deployed on a single server and each application uses log4j for logging

How to configure log4j so that only one application(the one I want) will write data to one log file

I dont want other applications to write their logs to this log file otherwise troubleshooting for a single application is difficult.

What can be done..

Thanks in advance

Sorry if this is a very simple question but I am not aware how to handle this

Best Regards
Ketan
Sandeep Kumar Jakkaraju
Ranch Hand

Joined: Feb 25, 2009
Posts: 75
you can use one log file for each class .... what else do you need .....
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

You can set up an appender per 'artifact', e.g. One for each application.


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
ketan joshi
Greenhorn

Joined: Sep 25, 2005
Posts: 3
Hello all,

Thanks for a quick feeback.
While I dont expect spoon feeding,I am a bit unclear when to set up a different log file for each application
Where to add the appender per artifact

If you can direct me to links which provide some details about making these configurations,I would be glad

Thanks a lot.
Ketan
Sandeep Kumar Jakkaraju
Ranch Hand

Joined: Feb 25, 2009
Posts: 75
please be a bit clear of the requirements .....

may be i can help ..... I am doing a Phd on Log4j ... my topic is "ROOT" Logger !!!
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Hi Ketan,

No worries, you want to have something like this:



Note the



and



Sections in particular.
Prashant Saraf
Ranch Hand

Joined: Sep 25, 2006
Posts: 52

if you are facing problem with overlapping your logs with other application log then your log configuration may have issue.
Thanks
Prashatn

 
 
subject: Log4j configuration help. Using different log files for different applications