This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes Multiple log files using Log4j    Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Reply locked New topic

Multiple log files using Log4j

sridhar mangipudi

Joined: Jun 26, 2008
Posts: 3

I want to generate log files based on package structure. Like com.temp.test in test.log ,also I am having a log file at application like app.log .

This is my requirement what has been logged in test.log should not be logged in app.log.This is my file.

# Log4j configuration file.
# Available levels are DEBUG, INFO, WARN, ERROR, FATAL

# Default logger
log4j.rootLogger=DEBUG, PFILE,TEST
# PFILE is the primary log file
log4j.appender.PFILE.layout.ConversionPattern=%p %d[%l][%C] %m%n
#log4j.appender.PFILE.layout.ConversionPattern=%p %d %m%n

log4j.appender.TEST.layout.ConversionPattern=%p %d[%l][%C] %m%n

Can youu help me!!!
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60737

Please do not cross-post the same question in multiple forums. It wastes people's time when multiple redundant conversations take place. Please read this for more information.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Multiple log files using Log4j
Similar Threads
Multiple log files using Log4j
need some help with a more advanced files with multiple appenders..
Multiple log files using Log4j
Log4j - log in different files, same jar , different Main classes
Log4J - File appender in 2 or more files for the same package.