Asking the developers here...

One thing I would like to accomplish is to use the same log4j config file
for different appservers. Unfortunately, each appserver has a different
logging root variable (${catalina.home} = Tomcat, ${jboss.server.log.dir} =
JBoss, etc.).

One way to solve this is to make sure all variable names are extracted from
a map. For example, JEE provides an ELResolver that provides an interface
to get the variable values.

If log4j had such an interface (does it?), then it would be possible to
allow a pre-processor to run before parsing the configuration file and
insert new variables as appropriate. In my example, I would probably inject
a "logRoot" variable and set to it the appropriate location based on what
kind of appeserver is running.

What do you guys think?


[1] http://docs.oracle.com/javaee/5/api/javax/el/ELResolver.html

-- 
Cheers,
Paul

Reply via email to