Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Omar Barkawi
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Omar Barkawi
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Tanzy ,

It's done. ;)
 
Tanzy Akhtar
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
welcome Omar..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic