Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the point of remote events for chainsaw log4j viewer?

http://logging.apache.org/chainsaw/quicktour.html

First feature.

I completed the tutorial, it simply showed how to visually use the GUI, it didn't go into much detail at all regarding this new feature. The best documentation I have found is this:

Just as Appenders send logging events outside of the log4j environment (to files, to smtp, to sockets, etc), Receivers bring logging events inside the log4j environment.

Receivers are meant to support the receiving of remote logging events from another process. For example, SocketAppender "appends" a logging event to a socket, configured for a specific host and port number. On the receiving side of the socket can be a SocketReceiver object. The SocketReceiver object receives the logging event, and then "posts" it to the log4j environment (LoggerRepository) on the receiving machine, to be handled by the configured appenders, etc. The various settings in this environment (Logger levels, Appender filters & thresholds) are applied to the received logging event.

Receivers can also be used to "import" log messages from other logging packages into the log4j environment.

Receivers can be configured to post events to a given LoggerRepository.

So...

What kind of logging strategy can I achieve using this new component that I couldn't use just from using chainsaw + simple log4j file appenders?

like image 332
Zombies Avatar asked Apr 13 '09 17:04

Zombies


People also ask

What is chainsaw in Log4j?

Chainsaw is a java-based GUI software tool to view and analyze computer log files - specifically logs generated by the Log4j logging system. Both Log4j and Chainsaw are Open source projects under Apache Software Foundation. The latest release is Chainsaw v2.

What is an Appender?

appender (plural appenders) (computing) A software component that appends data to a computer file.


1 Answers

Their are many interesting things you can do with remote events:
- Avoid to create files on application servers. Files are bad.
- Centralize logs in case of multiple application servers.
- View live production logs from from your local environment, even if chainsaw is not very sexy, the filtering capabilities are more handy than plain vi/grep.
- Log in database instead of files. Files are bad.

And probably much more !

like image 137
MatthieuP Avatar answered Oct 06 '22 04:10

MatthieuP