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 "Kalcevich, Daniel" <dk...@firstam.com> on 2005/11/30 23:02:04 UTC

Log4J problem on startup

When I start up Log4J, I get the following:

log4j:INFO Using URL
[jar:file:/C:/work/workspaces/DBI_workspace/listing_enforcer/deploy/batc
h/lib/axis-ant.jar!/log4j.properties] for automatic log4j configuration
of repository named [default].

I am running the program from a command line.  I am using Log4J
1.3_Alpha_7.  Is Log4J somehow using that for the configuration?  Does
it try to auto-detect the properties file?

Daniel 




---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: Log4J problem on startup

Posted by Jacob Kjome <ho...@visi.com>.
Yes, Log4j looks for either log4j.properties or log4j.xml (log4j.xml is used in
preference to log4j.properties if both are found) in the default package.  If
it exists and Log4j hasn't already been configured, it configures itself.  that
said, it is bad practice to add log4j config files in jars, especially those in
distributed packages.  It is less bad if it is your own jar and you understand
the consequences of it being there.

If you want to makes sure your own gets used, put the directory with your config
file on the classpath before other jars.  And you should use a log4j.xml file to
ensure that it gets used in preference to log4j.properties.

Jake

Quoting "Kalcevich, Daniel" <dk...@firstam.com>:

> When I start up Log4J, I get the following:
>
> log4j:INFO Using URL
> [jar:file:/C:/work/workspaces/DBI_workspace/listing_enforcer/deploy/batc
> h/lib/axis-ant.jar!/log4j.properties] for automatic log4j configuration
> of repository named [default].
>
> I am running the program from a command line.  I am using Log4J
> 1.3_Alpha_7.  Is Log4J somehow using that for the configuration?  Does
> it try to auto-detect the properties file?
>
> Daniel
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>




---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org