In a distributed environment, how can I configure log4j to log to different files for each JVM instance in the same host?

StackOverflow https://stackoverflow.com/questions/3024722

문제

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?

도움이 되었습니까?

해결책

I've find out a system property that already exists (IBM WAS ND 6.1) and provides the JVM name (am.appserver). But I'm open to alternative suggestions.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top