• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Tanzy ,

It's done. ;)
 
Tanzy Akhtar
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
welcome Omar..
reply
    Bookmark Topic Watch Topic
  • New Topic