This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Other Open Source Projects and the fly likes Creating logfiles for different services (Log4j) Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Products » Other Open Source Projects
Reply Bookmark "Creating logfiles for different services (Log4j)" Watch "Creating logfiles for different services (Log4j)" New topic
Author

Creating logfiles for different services (Log4j)

Gagan Grover
Greenhorn

Joined: Mar 02, 2007
Posts: 17
I have an application in which i am creating 3 services and i have the following log4j.properties file for the application.


Now, whenever i run these services from their main class all the service log files get generated but i want only the log file for that service should get generated. Can I achieve this thing in the same log4j.properties file or do i need to have separate properties file for each service? Please suggest.


Gags
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 8210
    
  71

Apparently not configurable. But you could write your own custom appender (extending the existing ones) to have the behaviour you desire.


[My Blog] [JavaRanch Journal]
Gagan Grover
Greenhorn

Joined: Mar 02, 2007
Posts: 17
Jaikiran Pai wrote:Apparently not configurable. But you could write your own custom appender (extending the existing ones) to have the behaviour you desire.


Thanks for your reply, i will try that.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Creating logfiles for different services (Log4j)
 
Similar Threads
max index files for logs not being stored.
Log4j in Eclipse Vs Log4j Outside Eclipse
question on log4j and eclipse
Using Netbean 6.8 to create a Servlet app that queries a database
Need help with log4j logging tool to log into database