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 Pedro Nuno Tavares da Silva <ps...@telbit.pt> on 2004/06/09 16:03:30 UTC

Log4j, JMSAppender e JBOSS newbie question

Hi,
 i am new using log4j and JBoss, and i'm trying to use the JMSAppender, 
i have seen an similar question/answer here, but the answer did not help 
me much. I am using log4j 1.2.8 and jboss 3.2.3, log4j is in debug mode. 
There's a j2ee client who logs to JMS and a Message Bean who will 
receive the logs...

My log4j.properties looks like this:

#  log4j.properties JMS
log4j.rootCategory=ALL, jms
### The JMS appender
log4j.appender.jms=org.apache.log4j.net.JMSAppender
log4j.appender.jms.layout=org.apache.log4j.SimpleLayout
log4j.appender.jms.TopicBindingName=topic/logger
log4j.appender.jms.TopicConnectionFactoryBindingName=ConnectionFactory


The topic/logger is created.

My jndi.properties looks like this:

java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.provider.url=localhost:1099
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces

I am forcing the reading of log4j.properties file with a line like this:

PropertyConfigurator.configure("/home/pns/workspace/MyEjbClient/log4j.properties");

The hole (sorry) debug output of log4j is:

log4j: Trying to find [log4j.xml] using context classloader 
sun.misc.Launcher$AppClassLoader@136228.
log4j: Trying to find [log4j.xml] using 
sun.misc.Launcher$AppClassLoader@136228 class loader.
log4j: Trying to find [log4j.xml] using ClassLoader.getSystemResource().
log4j: Trying to find [log4j.properties] using context classloader 
sun.misc.Launcher$AppClassLoader@136228.
log4j: Using URL 
[jar:file:/usr/java/jboss-3.2.3/bin/run.jar!/log4j.properties] for 
automatic log4j configuration.
log4j: Reading configuration from URL 
jar:file:/usr/java/jboss-3.2.3/bin/run.jar!/log4j.properties
log4j: Parsing for [root] with value=[DEBUG, FILE, CONSOLE].
log4j: Level token is [DEBUG].
log4j: Category root set to DEBUG
log4j: Parsing appender named "FILE".
log4j: Parsing layout options for "FILE".
log4j: Setting property [conversionPattern] to [%d{ABSOLUTE} %-5p 
[%c{1}] %m%n].
log4j: End of parsing for "FILE".
log4j: Setting property [append] to [false].
log4j: Setting property [file] to [/log/boot.log].
log4j:ERROR Failed to create directory structure: /log
log4j: setFile called: /log/boot.log, false
log4j:ERROR setFile(null,false) call failed.
java.io.FileNotFoundException: /log/boot.log (No such file or directory)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:102)
    at org.apache.log4j.FileAppender.setFile(FileAppender.java:272)
    at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:151)
    at 
org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:247)
    at 
org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:123)
    at 
org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:87)
    at 
org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:645)
    at 
org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:603)
    at 
org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:500)
    at 
org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:406)
    at 
org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:432)
    at 
org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:460)
    at org.apache.log4j.LogManager.<clinit>(LogManager.java:113)
    at org.apache.log4j.Logger.getLogger(Logger.java:94)
    at com.testing.client.TestClientM.<clinit>(TestClientM.java:36)
log4j: Parsed "FILE" options.
log4j: Parsing appender named "CONSOLE".
log4j: Parsing layout options for "CONSOLE".
log4j: Setting property [conversionPattern] to [%d{ABSOLUTE} %-5p 
[%c{1}] %m%n].
log4j: End of parsing for "CONSOLE".
log4j: Setting property [threshold] to [INFO].
log4j: Setting property [target] to [System.out].
log4j: Parsed "CONSOLE" options.
log4j: Finished configuring.
12:09:45,861 INFO  [TestClientM] Looking up the factory
log4j: Parsing for [root] with value=[ALL, jms].
log4j: Level token is [ALL].
log4j: Category root set to ALL
log4j: Parsing appender named "jms".
log4j: Setting property [topicConnectionFactoryBindingName] to 
[ConnectionFactory].
log4j: Setting property [topicBindingName] to [topic/logger].
log4j: Getting initial context.
log4j: Looking up [ConnectionFactory]
log4j:WARN No appenders could be found for logger 
(org.jboss.mq.referenceable.SpyConnectionFactoryObjectFactory).
log4j:WARN Please initialize the log4j system properly.
log4j: About to create TopicConnection.
log4j: Creating TopicSession, non-transactional, in AUTO_ACKNOWLEDGE mode.
log4j: Looking up topic name [topic/logger].
log4j: Creating TopicPublisher.
log4j: Starting TopicConnection.
log4j: Parsed "jms" options.
log4j: Finished configuring.


He, loads the log4.properties i can see that, bu he tells me that no 
"appenders could be found for logger", how can that be?

Sorry if my question looks too simple.

Thanks in advance, any help would be appreciated,
Pedro Silva.

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