In a distributed environment, how can I configure log4j to log to different files for each JVM insta

Posted by Renan Mozone on Stack Overflow See other posts from Stack Overflow or by Renan Mozone
Published on 2010-06-11T17:04:48Z Indexed on 2010/06/11 17:13 UTC
Read the original article Hit count: 437

My application runs on IBM WebSphere 6.1 Network Deployment. The application have several JSP files and Java classes. Today each host have only one JVM instance but my intention is to start another instance on each host. How can I configure log4j to log to different files for each JVM instance in the same host? I thought of using variable substitution on log4j XML configuration file but it only works with system properties. So, it is safe and recommended to set a custom system property just to store the JVM name? Anyone knows another strategy to achieve this in a 'elegant' way?

© Stack Overflow or respective owner

Related posts about java

Related posts about j2ee