You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by CodingPlayer <ro...@researchstudio.at> on 2008/02/20 18:08:19 UTC
multiple log4j.properties through dependencies?
Hi,
i just wonder what happens if one has two projects, one of them depending on
the other.
(Lets say: a util project and an application.)
and both of them use a "log4j.properties" file (with a different config
setting, e.g.: log level, console/file, ...)
i would guess that the file which comes first in the classpath is taken into
consideration.
So what is the best approach for such a situation?
only use ONE "log4j.properties" file in the (leaf) application project, and
don't use one in the dependent util project?
thx 4 help
R.C.
--
View this message in context: http://www.nabble.com/multiple-log4j.properties-through-dependencies--tp15593675p15593675.html
Sent from the Log4j - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org
Re: multiple log4j.properties through dependencies?
Posted by "James A. N. Stauffer" <st...@gmail.com>.
If the "util" project is considered a library than it shouldn't do any
config of log4j.
If it can run on its own than options include:
Tweaking the classpath order.
Using xml config because that is used in preference to properties.
Load each project in a different classloader.
On Wed, Feb 20, 2008 at 11:08 AM, CodingPlayer
<ro...@researchstudio.at> wrote:
>
> Hi,
>
> i just wonder what happens if one has two projects, one of them depending on
> the other.
> (Lets say: a util project and an application.)
>
> and both of them use a "log4j.properties" file (with a different config
> setting, e.g.: log level, console/file, ...)
>
> i would guess that the file which comes first in the classpath is taken into
> consideration.
>
>
> So what is the best approach for such a situation?
>
> only use ONE "log4j.properties" file in the (leaf) application project, and
> don't use one in the dependent util project?
>
> thx 4 help
> R.C.
> --
> View this message in context: http://www.nabble.com/multiple-log4j.properties-through-dependencies--tp15593675p15593675.html
> Sent from the Log4j - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>
--
James A. N. Stauffer http://www.geocities.com/stauffer_james/
Are you good? Take the test at http://www.livingwaters.com/good/
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org