This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Other Open Source Projects and the fly likes Doubt in Log4j 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 "Doubt in Log4j" Watch "Doubt in Log4j" New topic
Author

Doubt in Log4j

Sudhakar Rao
Ranch Hand

Joined: May 21, 2005
Posts: 36
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

Joined: Jul 20, 2005
Posts: 9313
    
109

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.


[My Blog] [JavaRanch Journal]
Sudhakar Rao
Ranch Hand

Joined: May 21, 2005
Posts: 36
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Doubt in Log4j
 
Similar Threads
Using Logging in EJB
log4j smtpappender
smartinspect
log4j wrapper
how to compile using Eclipse