This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Java in General and the fly likes Event logging framework Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Event logging framework" Watch "Event logging framework" New topic
Author

Event logging framework

Jiafan Zhou
Ranch Hand

Joined: Sep 28, 2005
Posts: 192

Does anybody know any event logging framework written in Java? Note that the event logging framework is different from those trace logging framework (e.g. log4j), I need and want a framework handles the system event logging into the database (e.g. one like Microsoft Event Viewer)

Regards,
Jiafan


SCJP, SCJD, SCWCD, SCBCD, SCEA
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 13867
    
  10

There's no fundamental difference between what you call "trace logging" and "event logging". Note that Log4J comes with different appenders, which you can use to send the output to different destinations - the console, a logfile, or a database. Look at JDBCAppender in Log4J, which is an appender that can insert log messages into a database.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Bert Bates
author
Sheriff

Joined: Oct 14, 2002
Posts: 8764
    
    5
moving to the intermediate forum


Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
Jiafan Zhou
Ranch Hand

Joined: Sep 28, 2005
Posts: 192

Is Log4J able to define a custom Event, which contains various fields(e.g. Type, Severity, Category and etc)?
Jiafan Zhou
Ranch Hand

Joined: Sep 28, 2005
Posts: 192

Also, how does the Log4J handle retrieving events from the database? I gave a glance at the Log4J's manual, there seems no such a "EventlogManager" which is responsible for persist and retrieve events from the database.

thanks
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 13867
    
  10

Have a look at this: Log4j JDBCAppender

With this, you can set up the table name and the layout of the table (the columns) any way you like. So if you want to log for example Type, Severity, Category etc. then yes, you can set it up like that.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Event logging framework
 
Similar Threads
log4j apache common logging
Roll over to another log file, when the size of log file is big...
Speeding up the use of system.out
Debugging code
How to Remove System.out.println() in my Application Code