Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Log4J for recording application events?

 
Bill Compton
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Our app will log 3 categories of events: debug, error, and "workflow". The first two obviously fit well with Log4J. The "workflow" category is for application events like "finished step N of job Z". These will be relatively infrequent (at least minutes between) and we would never configure them off. We plan to record debug with a RollingFileAppender and would typically configure it as turned off. We want to send error and workflow via JMS (JMSAppender?) to a MDB that will write them to two separate database tables. I assume we would use a custom "workflow" Level to differentiate the appender.

The workflow messages will have some structure -- at least job name, step name, and date/time. Options I see are:
A) Log as text and parse fields in MDB before persisting.
B) Log is an object to retain structure and avoid parsing.
C) Skip Log4J and write custom code for sending via JMS.

Is Log4J a good choice for our "workflow" messages?
Is option B even possible? (Relates to this topic.)

Thanks much!
[ March 13, 2007: Message edited by: Bill Compton ]
 
M Easter
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We did something similar to (a) a few years ago. I think we used a TelnetAppender but I think a JMSAppender is better.

Our approach was a proof-of-concept and didn't a full production environment, but it seemed to work pretty well in dev. The enabling idea is that log4j does its logging in a separate thread.
 
Carol Enderlin
drifter
Ranch Hand
Posts: 1364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Regarding the workflow scenario, be sure to take a look at FAQ Is log4j a reliable logging system?

No. log4j is not reliable. It is a best-effort fail-stop logging system.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic