Syslog is the oldest common way to move log lines off a machine. A program hands a message to the local daemon, usually rsyslog or syslog-ng. The daemon writes it to a file such as /var/log/syslog or forwards it to a central syslog server.
How it works
Every message starts with a priority in angle brackets. It packs two things into one number: priority = facility x 8 + severity. Facility says what kind of program sent it, such as auth, daemon or local0 to local7. Severity runs from 0 (emergency) to 7 (debug), the same scale most log levels borrow. A warning from facility local4 is 20 x 8 + 4 = 164.
An RFC 5424 line looks like <164>1 2026-11-18T09:14:03Z app-01 payments 4242 - - card check failed. After the priority come the version, timestamp, host, app name, process ID, a message ID, structured data and the free text. The structured data field holds key-value pairs, but most senders leave it as a dash.
Transport is the part that bites. Classic syslog uses UDP port 514, so a busy or restarting server drops messages and the sender never finds out. RFC 5425 adds TLS over TCP on port 6514. On the daemon side, rsyslog forwards with @host for UDP and @@host for TCP.
Why it matters in production
In One2N's post on routing sensitive logs, Hrithik Sawant describes a Spring Boot service writing about 10,000 logs per second. Some lines held sensitive data that only certain teams could see. A syslog server inside the private network collected those.
The first plan was to call the syslog server from the code, which meant changes in many places. Instead the team used the Log4j2 Syslog appender. A config along these lines sends one class to syslog and everything else to standard output:
<Appenders>
<Console name="Console" target="SYSTEM_OUT"/>
<Syslog name="Syslog" format="RFC5424" host="syslog.internal"
port="514" protocol="TCP" appName="logrouter" facility="LOCAL4"/>
</Appenders>
<Loggers>
<Logger name="com.one2n.logrouter.service.LogService" level="info" additivity="false">
<AppenderRef ref="Syslog"/>
</Logger>
<Root level="info"><AppenderRef ref="Console"/></Root>
</Loggers><Appenders>
<Console name="Console" target="SYSTEM_OUT"/>
<Syslog name="Syslog" format="RFC5424" host="syslog.internal"
port="514" protocol="TCP" appName="logrouter" facility="LOCAL4"/>
</Appenders>
<Loggers>
<Logger name="com.one2n.logrouter.service.LogService" level="info" additivity="false">
<AppenderRef ref="Syslog"/>
</Logger>
<Root level="info"><AppenderRef ref="Console"/></Root>
</Loggers><Appenders>
<Console name="Console" target="SYSTEM_OUT"/>
<Syslog name="Syslog" format="RFC5424" host="syslog.internal"
port="514" protocol="TCP" appName="logrouter" facility="LOCAL4"/>
</Appenders>
<Loggers>
<Logger name="com.one2n.logrouter.service.LogService" level="info" additivity="false">
<AppenderRef ref="Syslog"/>
</Logger>
<Root level="info"><AppenderRef ref="Console"/></Root>
</Loggers><Appenders>
<Console name="Console" target="SYSTEM_OUT"/>
<Syslog name="Syslog" format="RFC5424" host="syslog.internal"
port="514" protocol="TCP" appName="logrouter" facility="LOCAL4"/>
</Appenders>
<Loggers>
<Logger name="com.one2n.logrouter.service.LogService" level="info" additivity="false">
<AppenderRef ref="Syslog"/>
</Logger>
<Root level="info"><AppenderRef ref="Console"/></Root>
</Loggers><Appenders>
<Console name="Console" target="SYSTEM_OUT"/>
<Syslog name="Syslog" format="RFC5424" host="syslog.internal"
port="514" protocol="TCP" appName="logrouter" facility="LOCAL4"/>
</Appenders>
<Loggers>
<Logger name="com.one2n.logrouter.service.LogService" level="info" additivity="false">
<AppenderRef ref="Syslog"/>
</Logger>
<Root level="info"><AppenderRef ref="Console"/></Root>
</Loggers>additivity="false" keeps those lines out of the console. Plain syslog text is hard to query, so many teams send structured logs in the message, or receive syslog with the OpenTelemetry Collector and feed their observability stack.
See also
On the One2N blog
References
RFC 5424: The Syslog Protocol
Apache Log4j 2: Appenders