views:

119

answers:

1

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?

A: 

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.

Renan Vinícius Mozone
Please update your post, do not add answers to expand on your post
Romain Hippeau
My intention is to answer my own question. Shouldn't I do this?
Renan Vinícius Mozone
@Renan Vinícius Mozone If that is what you want to do, that's fine.
Romain Hippeau
A customer for one of my projects used a similar approach to ease deployment on test, integration and production environment: Each WAS instance defined a system property containing "test", "int" or "prod", which was used by the application to choose a configuration file.
Christian Semrau