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 "Sye, Karin" <ka...@lmco.com> on 2001/01/20 00:24:39 UTC

question about JMSAppender

Hi,

  I'm new to log4j.  The version of log4j  I'm using is 1.0.4.

  The JMSAppender class does not seem to pick up the PatternLayout specified
in the property file. (see below)
  How can I make that happen so that JMS client can receive the properly
layout logging messages?
  
  Thanks in advance for the help.

karin

 [ content of property file - jms.lcf ]
log4j.rootCategory=INFO, A1
log4j.configDebug=true
log4j.appender.A1=org.apache.log4j.net.JMSAppender
log4j.appender.A1.TopicBindingName=cn=topic1.1
log4j.appender.A1.TopicConnectionFactoryBindingName=cn=TopicConnectionFactor
y
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n


C:\sye\log4j>java MyApp2  jms.lcf
log4j: Parsing for [root] with value=[INFO, A1].
log4j: Priority token is [INFO].
log4j: Category root set to INFO
log4j: Parsing appender named "A1".
log4j: Option Threshold=[null].
log4j: Option TopicBindingName=[cn=topic1.1].
log4j: Option TopicConnectionFactoryBindingName=[cn=TopicConnectionFactory].
log4j: Parsed "A1" options.
log4j: Finished configuring.

  

Re: question about JMSAppender

Posted by Ceki Gulcu <cg...@urbanet.ch>.
Karin,

The JMSAppender does not require nor use a layout. It will publish a 
LoggingEvent object to the JMS topic that you specify. It is the 
responsibility of the subscriber (e.g. JMSSink) to format the LoggingEvent. 
I hope this answers the question. Ceki

At 15:24 19.01.2001 -0800, you wrote:
>Hi,
>
>   I'm new to log4j.  The version of log4j  I'm using is 1.0.4.
>
>   The JMSAppender class does not seem to pick up the PatternLayout specified
>in the property file. (see below)
>   How can I make that happen so that JMS client can receive the properly
>layout logging messages?
>
>   Thanks in advance for the help.
>
>karin
>
>  [ content of property file - jms.lcf ]
>log4j.rootCategory=INFO, A1
>log4j.configDebug=true
>log4j.appender.A1=org.apache.log4j.net.JMSAppender
>log4j.appender.A1.TopicBindingName=cn=topic1.1
>log4j.appender.A1.TopicConnectionFactoryBindingName=cn=TopicConnectionFactor
>y
>log4j.appender.A1.layout=org.apache.log4j.PatternLayout
>log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
>
>
>C:\sye\log4j>java MyApp2  jms.lcf
>log4j: Parsing for [root] with value=[INFO, A1].
>log4j: Priority token is [INFO].
>log4j: Category root set to INFO
>log4j: Parsing appender named "A1".
>log4j: Option Threshold=[null].
>log4j: Option TopicBindingName=[cn=topic1.1].
>log4j: Option TopicConnectionFactoryBindingName=[cn=TopicConnectionFactory].
>log4j: Parsed "A1" options.
>log4j: Finished configuring.
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: log4j-user-help@jakarta.apache.org

----
Ceki Gulcu (cgu@urbanet.ch)