Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Log4j - JMSAppender - ActiveMQ - JNDI

yann luppo
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

I've been using log4j for a little while with common appenders like RollingFileAppender, ConsoleAppender etc... But one of the requirement of my new project is to use the JMSAppender... Oh and I'm kind of new to Java, have been doing Java only for the past 5 months.
So as a fresh java developer trying to setup JMSAppender to talk to a local instance of ActiveMQ has proved to be quite challenging. To top it all I keep reading about JNDI, which event though I kinda understand what it does, I'm not sure how that fits in this architecture.

The setup I need to have that to work on for now is my local dev box with Tomcat for the web app part that will use the JMSAppender to log messages to the ActiveMQ local server. I don't really know yet how to code the dequeuing part, but since I can't even seem to have a correct configuration going for simply queueing messages, I think I'll cross that bridge when I get there.

So far here is what I have in the log4j.xml concerning the JMSAppender:

I'm not exactly sure what the parameters InitialContextFactoryName, QueueBindingName and QueueConnectionFactoryBindingName should be... the values associated with those parameters are inspired by some very simple examples I've found online.

Anyone who has already done that could help me, or point me to the right direction by any chance?

Thank you,
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic