On 28.11.2013 12:41, Keve Nagy wrote:
> I was still hoping to avoid the use of the extra gear of syslogd in the
> mechanics of the solution. But I will use it if no other solution works.
In my opinion, going through syslogd should be the preferred solution --
whenever possible. That's because syslog.conf's syntax allows a number of
interesting things to be done to each message -- or a subset of them:
* suppress duplicate messages, that various programs begin to spout (at
high rates) once in a while;
* forward to a different host -- such as for automated analysis,
aggregation and archiving;
* store entries in multiple files -- which can then be processed by
different rules;
* broadcast to logged-in users;
* pipe into programs -- with all the freedom that entails.
Though with the original syslogd-implementations one's ability to filter
messages was limited to the enumerated "facilities" (such as "news" or "local1")
and log-levels, the FreeBSD implementation today let's you sort messages by the
"tag" (which is, typically, the name of the originating program). You can also
deal differently with messages originating from different hosts. For example,
here are bits from my current syslog.conf:
# Write whatever Varnish has to say into a single file:
!varnishd
*.* /var/log/varnish.log
# Configure Drupal's syslogd module to tag messages as "drupal"
!drupal
*.* /var/log/drupal.log
...
# Tell your router to send log-entries to your loghost:
+router
*.* /var/log/router.log
Even if you don't need any of these features in your application today, you are
likely to want (or even need!) some of them later. syslogd is already running on
your systems -- there is no overhead or other additional costs to using it.
-mi