• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt in Log4j

 
Sudhakar Rao
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
In my project we are using log4j for logging purpose. In my project there is a interface with the name DC. But there will be different instances for it like DC1,DC2,DC3 etc. How can they will have different log files for each DC. Is it possible or not? If yes, how can we achieve it. Its very urgent
Thanks in Advane
Sudhakar
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can do something like:






In the log4j.xml:



Ofcourse, as and when the number of instances of the interface increase, the configuration file keeps growing.
 
Sudhakar Rao
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know how many instances will be there in my project. Its going to be dynamic. So I want to create the logfiles also dynamically. Hope I clearly mentioned my doubts
Thanks
Sudhakar
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic