• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Log4j configuration help. Using different log files for different applications

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you can use one log file for each class .... what else do you need .....
 
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ketan,

No worries, you want to have something like this:



Note the



and



Sections in particular.
 
Ranch Hand
Posts: 57
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic