No, but I am not sure this what I am looking for either. I am looking for
the programmatic injection of properties; I can't accomplish this using a
declarative approach. I want a class to be called by log4j at startup.


On Mon, Apr 14, 2014 at 12:15 PM, Ralph Goers <[email protected]>wrote:

> Have you looked at
> http://logging.apache.org/log4j/2.x/manual/configuration.html#PropertySubstitution
> ?
>
> Ralph
>
>
> On Apr 14, 2014, at 9:32 AM, Paul Benedict <[email protected]> wrote:
>
> 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
>
>
>


-- 
Cheers,
Paul

Reply via email to