Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

It is possible to use "log4j jms appender" to send messages to a QUEUE instead of a TOPIC (like I found in all the examples.)

Tags:

java

jms

log4j

Like the title said, I want to send logs using "log4j.appender.jms" but to a queue. The configuration that I have is this:

log4j.appender.jms=org.apache.log4j.net.JMSAppender
log4j.appender.jms.InitialContextFactoryName=org.apache.activemq.jndi.ActiveMQInitialContextFactory
log4j.appender.jms.ProviderURL=tcp://localhost:61616
log4j.appender.jms.TopicBindingName=logTopic
log4j.appender.jms.TopicConnectionFactoryBindingName=ConnectionFactory
log4j.appender.jms.Threshold=ERROR

This configuration is working, but like you see, is sending the information to a Topic instead of a Queue.

So I want to know if someone knows if is possible to send this logs to a queue using an appender like this one? Any suggestions of how can I do this?.

Thanks in advance.

like image 367
Juano7894 Avatar asked Dec 05 '25 13:12

Juano7894


1 Answers

No, not using the base code. See here, the log4j JMSAppender uses Topics not Queues. You could always create a clone of this appender and switch all the Topics to Queues.

like image 69
John Ament Avatar answered Dec 07 '25 23:12

John Ament



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!