On 12/12/06, John Heitmann <[EMAIL PROTECTED]> wrote:
After upgrading our systems from 4.0 to 4.1 I am having a tough time
figuring out how to configure log4j. Our old system had a
log4j.properties file in a custom spot that we had ActiveMQ pull in
with "--extdir /some/config/dir".

Hmm, not completely sure why. Just adding the directory containing the
config files to the classpath should do the trick


This doesn't seem to be working
anymore. ActiveMQ can't find the properties file on the classpath
when it's not in the standard spot. Any idea on what could be going
wrong? You can reproduce this by-- in the binary distribution--
moving conf/log4j.properties to config/log4j.properties, and then
play around with the -classpath and --extdir settings. None seem to
work.

I dug into the code a bit and saw this new check in the activemq-
console class loader:

if( files[j].getName().endsWith(".zip") || files[j].getName().endsWith
(".jar")  ){
     try{
         System.out.println("Adding to classpath: " + files
[j].getCanonicalPath()); }catch(Exception e){}
         urls.add(files[j].toURL());
      }
}

When I add ".properties" to the conditional I can see the printout
saying the properties file is added, however when I query the class
loader later in one of our custom beans running alongside the broker
it can't get the "log4j.properties" resource.

AFIAK log4j will look on the classpath for log4j.properties - so will
end up looking in the directories on the classpath. So the directory
containing the file needs to be on the classpath - not the properties
files. Adding files to the classpath is only relevant for jars and
zips

--

James
-------
http://radio.weblogs.com/0112098/

Reply via email to