File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Open Source Projects and the fly likes Log4j : specific class to log on FileAppender other classes log on Console Appender. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Log4j : specific class to log on FileAppender other classes log on Console Appender." Watch "Log4j : specific class to log on FileAppender other classes log on Console Appender." New topic
Author

Log4j : specific class to log on FileAppender other classes log on Console Appender.

Omar Barkawi
Greenhorn

Joined: Sep 28, 2009
Posts: 3
Hello ,

Please help me in this issue , am trying to make log4j to log a specific class (exceptions, messages, etc..) on FileAppender , other classes should should append to the consoleAppender.

I've tried the following code :



When I try to log on the file nothing happens on FileAppender , but the logs are viewed on the Console using ConsoleAppender.

Any help will be appriciated.

Thanks in advance.

Tanzy Akhtar
Ranch Hand

Joined: Jul 19, 2009
Posts: 110
Hi Omar,

I did not get this --

<logger name="com.companyName.logger.FileAppender">
<level value="WARN"/>
<appender-ref ref="Daily"/>
</logger>


What i understand value of "name" must be some package name for which
you need this specific logs in "LogFile.log".


Thanks,
Tanzy.


Roll with punchers, there is always tomorrow.
Techie Blog -- http://jtanzy.blogspot.com/
Omar Barkawi
Greenhorn

Joined: Sep 28, 2009
Posts: 3
Thank you Tanzy ,

It's done. ;)
Tanzy Akhtar
Ranch Hand

Joined: Jul 19, 2009
Posts: 110
welcome Omar..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Log4j : specific class to log on FileAppender other classes log on Console Appender.
 
Similar Threads
Capture logs to file via log4j.xml
Avoid additional server.log debug lines
How to use log4j.jdbcplus.JDBCAppender in log4j.xml
how to disable the log
struts 2 and log4j