I am developing many applications that working together and now having discussion how to consolidate logs. What I am seeing from many applications, they all dump logs to /var/log/ or any directory related to application itself.
Ex. /var/log/hadoop, /var/log/access_log, etc.
But my colleague said "just put everything in Syslog". So, everything is centralised and easy to troubleshoot. We don't have to know where log is setting in each application.
So, what is the advantage of using syslog over putting log file in your own application? Is it just developer centric to put log file in /var/log/ or any directory of their choices? or it is actually the best practice over syslog?
A big advantage of syslog is that the log server can monitor a vast number of syslog events via log files. Routers, switches, firewalls, and servers can generate log messages, as well as many printers and other devices.
As large networks generate a lot of Syslog data they need to be able to store the Syslog data for quick retrieval and easy reference. It is hard to find specific log entries in a large amount of data. A Syslog server allows you to collect as well as filter the logs.
Rsyslog is mainly available for Linux and recently for Solaris. The syslog-ng application is highly portable and available for many more platforms including AIX, HP-UX, Linux, Solaris, Tru64 and most variants of BSD. This makes syslog-ng more suitable for sites with diverse platforms.
When you send your logs to syslog, logs can be processed by the syslog daemon (rsyslog for instance) in various ways:
In fact I don't see any good reason to write logs directly to some file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With