I got this from http://www.javaworld.com/javaworld/jw-04-2001/jw-0427-letters.html
(ok, I did not work with syslog, but I could not understand why syslog in the author�s viewpoint is better...all features claimed to syslog do happen in Log4j!)
------------------------------------------------------------------------
Logging Systems
'Robust event logging with Syslog'
Nate Sammons
How does Syslog compare with Log4J?
Nate,
Syslog sounds nice, but why should I use Syslog and not Log4J. Is Syslog better than Log4J? How is Syslog different?
Geert Mergan
Geert,
First, I want to say that Log4J is, as far as I know, a good product.
I think that Syslog has a simpler API for writing messages. In Log4J, you have to retrieve an instance of a Category object before you can log, like this:
Category cat = Category.getInstance("com.foo");
cat.info("Here is a message");
With Syslog, you just call static methods:
Syslog.info("Here is a message");
Categories in Log4J are roughly equivalent to channels in Syslog. They can both be used to route messages.
I think Syslog's configurations are more flexible. With Syslog, you can modify a running configuration and ask it to write its configuration out to an XML file to be read in later.
In addition, Syslog has more loggers. It includes loggers that write to output streams (like System.out), regular files, files that rotate before they grow to a certain size, and files that rotate every hour (or minute, week, or month). It also includes loggers that write to Java Message Service, Remote Method Invocation, databases, and to a logger that sends email (text or HTML). That being said, writing your own logger is as simple as implementing an interface, and common functionality is inherited from the base logger class that comes with Syslog.
Syslog's log policies allow extremely fine-grained use. Let's say that you log everything on all channels at the WARNING level or above. If you have problems with one particular object, you can add a logger at runtime that singles out that object -- by class name or a pattern of class names, which is good for selecting a package -- and logs everything coming from that object to a separate log.
At their hearts, Log4J and Syslog want to do basically the same thing -- log messages in a flexible way and not interfere with coding and performance.
Nate Sammons
