aspose file tools
The moose likes Other Open Source Projects and the fly likes Log4j output files Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Reply Bookmark "Log4j output files" Watch "Log4j output files" New topic
Author

Log4j output files

Fisher Daniel
Ranch Hand

Joined: Sep 14, 2001
Posts: 582
Hi all,
I have an application that consists of some business modules.
And I am going to use log4j to log every incoming request to that modules.
I want every module have own log files so I can trace every request in each module.

I try to setting the log4j.properties file like this



Example module A using R1 and module B using R2.
How can I use that inside my classes in each module?

Thanks
daniel
Shreeya Joshi
Greenhorn

Joined: Nov 29, 2004
Posts: 6
You will have to add following

log4j.category.Module1=DEBUG,R1

log4j.category.Module2=DEBUG,R2

Then you can do following to check logging

Category cat = Category.getInstance(yourClassFromModule1.class.getName());
cat.info("Opened log file");
Murtuza Akhtari
Ranch Hand

Joined: Aug 07, 2004
Posts: 108
hey Shreeya,

Can we do something like that using Logger class since Category is deprecated in the version tht i m using (log4j-1.2.8)

Thanks,


---<br />SCJP 1.4
 
 
subject: Log4j output files
 
Threads others viewed
problem in configure Log4j with chainsaw
using log4j in Servlets
Log4j in a web application
Log4J - File appender in 2 or more files for the same package.
problem in configure Log4j with chainsaw
Two Laptop Bag

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture