You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Sridhar Laxmipuram Srinivasan <sr...@yahoo-inc.com> on 2010/09/21 12:39:26 UTC

Multiple log4j properties file

Hi,
Can anyone suggest me how to specify log4j.properties file at run time thru maven command line?
My requirement is I have multiple projects and all of them get kicked off for execution parallely, in this case my log4j properties file is getting messed up as both the project's logs are written in either of the 2 log4j files chosen randomly, and I want to avoid this

thnkx
sridharl


Re: Multiple log4j properties file

Posted by Stuart Sierra <ma...@stuartsierra.com>.
On Thu, Sep 23, 2010 at 11:38 PM, Sridhar Laxmipuram Srinivasan
<sr...@yahoo-inc.com> wrote:
> Oh! So you are including a different log4j file thru system properties ?

No, I use one Log4J properties file, with system properties inside it.
 Like this:

    log4j.rootLogger=debug, R
    log4j.appender.R=org.apache.log4j.RollingFileAppender
    log4j.appender.R.File=${log.file.name}.log

Then I can set the system property "log.file.name" at the command line
to control where the log file goes.

-S

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Multiple log4j properties file

Posted by Sridhar Laxmipuram Srinivasan <sr...@yahoo-inc.com>.
Oh! So you are including a different log4j file thru system properties ?
It would be of gr8 help if you can show me an example pom with 2 profiles which has 2 log4j property file specified :)

Thnkx
sridharl

-----Original Message-----
From: the.stuart.sierra@gmail.com [mailto:the.stuart.sierra@gmail.com] On Behalf Of Stuart Sierra
Sent: Friday, September 24, 2010 7:07 AM
To: Maven Users List
Subject: Re: Multiple log4j properties file

One technique I've used is to embed Java system properties in the
log4j.properties file with the ${property.name} syntax. Then I set
that property to a different value for each process.

-S


On Tue, Sep 21, 2010 at 6:39 AM, Sridhar Laxmipuram Srinivasan
<sr...@yahoo-inc.com> wrote:
> Hi,
> Can anyone suggest me how to specify log4j.properties file at run time thru maven command line?
> My requirement is I have multiple projects and all of them get kicked off for execution parallely, in this case my log4j properties file is getting messed up as both the project's logs are written in either of the 2 log4j files chosen randomly, and I want to avoid this
>
> thnkx
> sridharl
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Multiple log4j properties file

Posted by Stuart Sierra <ma...@stuartsierra.com>.
One technique I've used is to embed Java system properties in the
log4j.properties file with the ${property.name} syntax. Then I set
that property to a different value for each process.

-S


On Tue, Sep 21, 2010 at 6:39 AM, Sridhar Laxmipuram Srinivasan
<sr...@yahoo-inc.com> wrote:
> Hi,
> Can anyone suggest me how to specify log4j.properties file at run time thru maven command line?
> My requirement is I have multiple projects and all of them get kicked off for execution parallely, in this case my log4j properties file is getting messed up as both the project's logs are written in either of the 2 log4j files chosen randomly, and I want to avoid this
>
> thnkx
> sridharl
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org