Centralized Logging for many Java Apps: Syslog vs JMS vs Http vs Local file

java, jms, logging, rest, syslog

Solution

Depends on your requirements. Logging to a queue (as in JMS) gives you the most flexibility of your options as your log operation can return as soon as the log message has been written to the queue. You are then free to have another process take those log messages off the queue and write them to your preferred logging store (database, file system, ...).

The (slight) downside is your log messages will lag slightly behind the system that is logging, but this is almost always the case, even with file-based logging.

Problem

I want all my applications log to be centralized (ideally in near real-time). We will use a Log4 Appender. Which one should I use: - Send log event in a JMS Queue - Syslog / syslog-ng - Write to a localfile and use rsync (every 3second) to replicate the log - Do a POST to a centralized REST Http Service Which one are you using?

Original source