aspose 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
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.