logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yogesh Rao" <Yogesh....@mphasis.com>
Subject JMSAppender for Log4j with Qpid
Date Fri, 28 Aug 2009 05:38:31 GMT
Hi,

 

I am trying to use the JMSAppender provided by log4j with QPID and it
seems that a timeout occurs when connecting to the broker. The method
used is publish / subscribe.

 

Following is the log4j xml defined :-

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">

<appender name="xyz" class="org.apache.log4j.net.JMSAppender">

<param name="InitialContextFactoryName"
value="org.apache.qpid.jndi.PropertiesFileInitialContextFactory" />

<param name="ProviderURL"
value="D:/workspace/projects/QPID/src/com/example/logging/jndi.propertie
s"/>

<!-- param name="ProviderURL" value="tcp://localhost:5672" /--> 

<param name="TopicBindingName" value="log" />

<param name="TopicConnectionFactoryBindingName"
value="qpidConnectionfactory" /> 

</appender>

<root>

<priority value ="all" />

<appender-ref ref="xyz"/>

</root>

</log4j:configuration> 

 

JNDI Properties :-

java.naming.factory.initial=org.apache.qpid.jndi.PropertiesFileInitialCo
ntextFactory

connectionfactory.qpidConnectionfactory =
amqp://guest:guest@localhost/test?brokerlist='tcp://localhost:5672'

topic.log = logTopic

 

Code :-

 

DOMConfigurator.configure("D:/workspace/projects/QPID/src/com/example/lo
gging/log4j.xml"); 

Logger logger = Logger.getLogger(SimpleTestClient.class);

logger.debug("Test Message 1");

logger.info("TestMessage 2 ");

logger.warn("Test Message 3");

logger.error("Test Message 4");

logger.fatal("Fatal Test 5");

 

Exception :-

main 2009-08-26 18:16:50,780 INFO [apache.qpid.client.AMQConnection]
Unable to connect to broker at tcp://localhost:5672

java.io.IOException: Timeout waiting for connection.

at
org.apache.qpid.client.transport.SocketTransportConnection.connect(Socke
tTransportConnection.java:128)

at
org.apache.qpid.client.AMQConnectionDelegate_8_0.makeBrokerConnection(AM
QConnectionDelegate_8_0.java:94)

at
org.apache.qpid.client.AMQConnection.makeBrokerConnection(AMQConnection.
java:728)

at org.apache.qpid.client.AMQConnection.<init>(AMQConnection.java:520)

at
org.apache.qpid.client.AMQConnectionFactory.createConnection(AMQConnecti
onFactory.java:276)

at
org.apache.qpid.client.AMQConnectionFactory.createTopicConnection(AMQCon
nectionFactory.java:343)

at
org.apache.log4j.net.JMSAppender.activateOptions(JMSAppender.java:212)

at
org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:257)

at
org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:
285)

at
org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.
java:171)

at
org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigur
ator.java:184)

at
org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMCon
figurator.java:502)

at
org.apache.log4j.xml.DOMConfigurator.parseRoot(DOMConfigurator.java:471)

at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:921)

at
org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:79
0)

at
org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:68
2)

at
org.apache.log4j.xml.DOMConfigurator.configure(DOMConfigurator.java:811)

at com.example.logging.SimpleTestClient.main(SimpleTestClient.java:28)

 

I have checked the brokers and it is running and available on 5672 port.
I am able to connect to it writing sample test code.

 

It would be great if anyone has actually tried asynch logging with QPID
using the org.apache.log4j.net.JMSAppender share their veiws.

 

Thanks in advance !!

 

Regards,

-Yogesh

 

________________________________

This communication is for informational purposes only. It is not
intended as an offer or solicitation for the purchase or sale of any
financial instrument or as an official confirmation of any transaction.
All market prices, data and other information are not warranted as to
completeness or accuracy and are subject to change without notice. Any
comments or statements made herein do not necessarily reflect those of
JPMorgan Chase & Co., its subsidiaries and affiliates. This transmission
may contain information that is privileged, confidential, legally
privileged, and/or exempt from disclosure under applicable law. If you
are not the intended recipient, you are hereby notified that any
disclosure, copying, distribution, or use of the information contained
herein (including any reliance thereon) is STRICTLY PROHIBITED. Although
this transmission and any attachments are believed to be free of any
virus or other defect that might affect any computer system into which
it is received and opened, it is the responsibility of the recipient to
ensure that it is virus free and no responsibility is accepted by
JPMorgan Chase & Co., its subsidiaries and affiliates, as applicable,
for any loss or damage arising in any way from its use. If you received
this transmission in error, please immediately contact the sender and
destroy the material in its entirety, whether in electronic or hard copy
format. Thank you. Please refer to
http://www.jpmorgan.com/pages/disclosures for disclosures relating to
European legal entities. 


Information transmitted by this e-mail is proprietary to MphasiS, its associated companies
and/ or its customers and is intended 
for use only by the individual or entity to which it is addressed, and may contain information
that is privileged, confidential or 
exempt from disclosure under applicable law. If you are not the intended recipient or it appears
that this mail has been forwarded 
to you without proper authority, you are notified that any use or dissemination of this information
in any manner is strictly 
prohibited. In such cases, please notify us immediately at mailmaster@mphasis.com and delete
this mail from your records.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message