• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Log4j configuration help. Using different log files for different applications

 
ketan joshi
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can use one log file for each class .... what else do you need .....
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can set up an appender per 'artifact', e.g. One for each application.
 
ketan joshi
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ketan,

No worries, you want to have something like this:



Note the



and



Sections in particular.
 
Prashant Saraf
Ranch Hand
Posts: 57
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if you are facing problem with overlapping your logs with other application log then your log configuration may have issue.
Thanks
Prashatn

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic