Syslog — Forward MideyeServer Logs to Syslog Servers
MideyeServer can forward log events to syslog servers for centralized log collection, correlation with other system logs, and integration with SIEM (Security Information and Event Management) platforms.
Quickstart — send logs to syslog in 2 minutes
Section titled “Quickstart — send logs to syslog in 2 minutes”Getting syslog forwarding to work requires two pieces in logback.xml. This is
the most common source of confusion — adding only one of the two will not work:
- The appender — defines where and how to send logs (server address, port, format)
- A logger reference — tells Logback to actually use the appender for matching log events
Think of it like a mailbox and a mail carrier: the appender is the mailbox (it knows the destination), but without the logger reference nothing will ever put mail into it.
Copy both blocks into your logback.xml, adjust syslogHost, save, and logs
will start flowing within 60 seconds (Logback auto-reloads the file):
<!-- 1) APPENDER — defines the syslog destination --><appender name="SYSLOG" class="ch.qos.logback.classic.net.SyslogAppender"> <syslogHost>syslog.example.com</syslogHost> <!-- ← change this --> <facility>LOCAL0</facility> <port>514</port> <suffixPattern>mideyeserver %d{ISO8601,UTC} %p [%t] %c{0} - %m%n</suffixPattern></appender>
<!-- 2) LOGGER REFERENCE — connects the appender to the log stream --><root level="WARN"> <appender-ref ref="SYSLOG" /></root>For the full configuration file path on your platform, see Overview.
Approaches to syslog integration
Section titled “Approaches to syslog integration”This page covers three approaches, from simplest to most robust:
| Method | Transport | Reliability | Complexity | Best for |
|---|---|---|---|---|
| Logback SyslogAppender | UDP only | Standard | Low | Simple local syslog |
| rsyslog imfile | TCP, TLS, RELP | High | Medium | Production deployments |
| syslog-ng file source | TCP, TLS | High | Medium | Existing syslog-ng setups |
Logback SyslogAppender
Section titled “Logback SyslogAppender”MideyeServer’s logback.xml includes a commented-out SyslogAppender configuration. This is the simplest option for local or UDP-based syslog forwarding.
Limitations
Section titled “Limitations”- UDP only — no TCP or TLS support
- No buffering — logs may be lost during restarts or network issues
- Fire-and-forget — no delivery confirmation
Configuration
Section titled “Configuration”-
Edit logback.xml
Location: See Overview for platform-specific paths.
-
Uncomment the SYSLOG appender
Find this section near the end of the file and remove the comment markers:
logback.xml <appender name="SYSLOG" class="ch.qos.logback.classic.net.SyslogAppender"><syslogHost>localhost</syslogHost><facility>LOCAL0</facility><port>514</port><suffixPattern>java %d{ISO8601,UTC} %p %t %c %M - %m%n</suffixPattern></appender> -
Customize settings
Parameter Description Default Recommendation syslogHostHostname or IP of syslog server localhostUse remote server IP for centralized logging portUDP port 514Standard syslog port (may require firewall rules) facilitySyslog facility code LOCAL0Use LOCAL0–LOCAL7for application logssuffixPatternLog message format ISO8601 timestamp + log details Customize to match your syslog parser Example for remote server:
logback.xml <appender name="SYSLOG" class="ch.qos.logback.classic.net.SyslogAppender"><syslogHost>syslog.example.com</syslogHost><facility>LOCAL6</facility><port>514</port><suffixPattern>mideyeserver %d{ISO8601,UTC} %p [%t] %c{0} - %m%n</suffixPattern></appender> -
Attach appender to root logger
Uncomment and customize the root logger configuration for syslog:
logback.xml <!-- Send WARN and higher to syslog --><root level="WARN"><appender-ref ref="SYSLOG" /></root>Or attach to a specific logger for selective forwarding:
logback.xml <!-- Send only MideyeServer errors to syslog --><logger name="com.mideye.mideyeserver" level="ERROR" additivity="false"><appender-ref ref="SYSLOG"/></logger> -
Save and verify
Changes take effect automatically within 60 seconds. Check your syslog server to confirm messages are arriving.
Common facilities
Section titled “Common facilities”| Facility | Numeric Code | Typical Use |
|---|---|---|
USER | 1 | User-level messages (default) |
LOCAL0 | 16 | Local use 0 (custom applications) |
LOCAL1 | 17 | Local use 1 |
LOCAL2 | 18 | Local use 2 |
LOCAL3 | 19 | Local use 3 |
LOCAL4 | 20 | Local use 4 |
LOCAL5 | 21 | Local use 5 |
LOCAL6 | 22 | Local use 6 |
LOCAL7 | 23 | Local use 7 |
rsyslog imfile module (recommended)
Section titled “rsyslog imfile module (recommended)”The imfile module allows rsyslog to tail log files and forward them to remote syslog servers with TCP, TLS, and reliable message queuing.
Prerequisites
Section titled “Prerequisites”- rsyslog installed on the MideyeServer host (typically included in Linux distributions)
- rsyslog with
imfilemodule (standard in rsyslog 8.0+)
Configuration
Section titled “Configuration”-
Create rsyslog configuration file
Terminal window sudo nano /etc/rsyslog.d/30-mideyeserver.conf -
Add imfile configuration
/etc/rsyslog.d/30-mideyeserver.conf # Load imfile module (if not already loaded)module(load="imfile" PollingInterval="10")# MideyeServer main loginput(type="imfile"File="/opt/mideyeserver6/log/mideyeserver.log"Tag="mideyeserver"Severity="info"Facility="local6"reopenOnTruncate="on")# MideyeServer error loginput(type="imfile"File="/opt/mideyeserver6/log/mideyeserver.error"Tag="mideyeserver-error"Severity="error"Facility="local6"reopenOnTruncate="on")# Forward to remote syslog server (TCP)if $syslogtag contains 'mideyeserver' then @@syslog.example.com:514 -
Choose forwarding protocol
Protocol Syntax Description UDP @server:514Fire-and-forget, fast, may lose messages TCP @@server:514Reliable, confirms delivery TCP with TLS @@server:6514Encrypted, requires TLS setup RELP :omrelp:server:2514Reliable Event Logging Protocol Example: TCP forwarding
if $syslogtag contains 'mideyeserver' then @@syslog.example.com:514Example: TLS forwarding
# TLS configuration (add before the forwarding rule)$DefaultNetstreamDriver gtls$DefaultNetstreamDriverCAFile /etc/ssl/certs/ca-bundle.crt$ActionSendStreamDriverMode 1$ActionSendStreamDriverAuthMode x509/name$ActionSendStreamDriverPermittedPeer syslog.example.com# Forward over TLSif $syslogtag contains 'mideyeserver' then @@syslog.example.com:6514 -
Test configuration syntax
Terminal window sudo rsyslogd -N1Look for errors related to your configuration file.
-
Restart rsyslog
Terminal window sudo systemctl restart rsyslogsudo systemctl status rsyslog -
Verify forwarding
Check your remote syslog server to confirm MideyeServer logs are arriving with the
mideyeservertag.
Advanced: local filtering before forwarding
Section titled “Advanced: local filtering before forwarding”Filter log events before sending to reduce network traffic:
# Forward only ERROR and WARN messagesif $syslogtag contains 'mideyeserver' and ($syslogseverity <= 4) then @@syslog.example.com:514
# Forward INFO and higherif $syslogtag contains 'mideyeserver' and ($syslogseverity <= 6) then @@syslog.example.com:514Syslog severity mapping:
| Priority | Severity | Numeric |
|---|---|---|
| Emergency | emerg | 0 |
| Alert | alert | 1 |
| Critical | crit | 2 |
| Error | err | 3 |
| Warning | warning | 4 |
| Notice | notice | 5 |
| Informational | info | 6 |
| Debug | debug | 7 |
Advanced: queue configuration for reliability
Section titled “Advanced: queue configuration for reliability”Add message queuing to handle network outages:
# Create a disk-assisted queue for reliable forwarding$ActionQueueType LinkedList$ActionQueueFileName mideyeserver_queue$ActionQueueMaxDiskSpace 1g$ActionQueueSaveOnShutdown on$ActionQueueTimeoutEnqueue 0$ActionResumeRetryCount -1
# Forward with queueif $syslogtag contains 'mideyeserver' then @@syslog.example.com:514syslog-ng file source
Section titled “syslog-ng file source”If you use syslog-ng instead of rsyslog, configure a file source to tail MideyeServer logs.
Configuration
Section titled “Configuration”-
Create syslog-ng configuration file
Terminal window sudo nano /etc/syslog-ng/conf.d/mideyeserver.conf -
Add file source and destination
/etc/syslog-ng/conf.d/mideyeserver.conf # Source: tail MideyeServer log filessource s_mideyeserver {file("/opt/mideyeserver6/log/mideyeserver.log"follow-freq(1)flags(no-parse)program-override("mideyeserver"));};source s_mideyeserver_error {file("/opt/mideyeserver6/log/mideyeserver.error"follow-freq(1)flags(no-parse)program-override("mideyeserver-error"));};# Destination: remote syslog server (TCP)destination d_remote_syslog {syslog("syslog.example.com"transport("tcp")port(514));};# Log path: connect source to destinationlog {source(s_mideyeserver);source(s_mideyeserver_error);destination(d_remote_syslog);}; -
TCP with TLS
/etc/syslog-ng/conf.d/mideyeserver.conf destination d_remote_syslog_tls {syslog("syslog.example.com"transport("tls")port(6514)tls(ca-dir("/etc/ssl/certs")peer-verify(required-trusted)));};log {source(s_mideyeserver);destination(d_remote_syslog_tls);}; -
Test and restart
Terminal window # Test configurationsudo syslog-ng -s# Restart syslog-ngsudo systemctl restart syslog-ngsudo systemctl status syslog-ng
Verifying syslog forwarding
Section titled “Verifying syslog forwarding”On the MideyeServer host
Section titled “On the MideyeServer host”-
Generate a test log message
Use the Log Configuration page to temporarily lower the log level to INFO or DEBUG, or trigger an event (e.g., failed authentication attempt).
-
Check local syslog
Terminal window sudo tail -f /var/log/syslog | grep mideyeserverTerminal window sudo tail -f /var/log/messages | grep mideyeserver
On the remote syslog server
Section titled “On the remote syslog server”-
Watch incoming logs
Terminal window sudo tail -f /var/log/syslog | grep mideyeserver -
Check for network connectivity
Terminal window # Test UDP syslog portnc -vu syslog.example.com 514# Test TCP syslog portnc -v syslog.example.com 514
Troubleshooting
Section titled “Troubleshooting”Logs not appearing on remote server
Section titled “Logs not appearing on remote server”Check network connectivity:
ping syslog.example.comtelnet syslog.example.com 514Check firewall rules:
# Allow outbound UDP/TCP 514sudo firewall-cmd --add-port=514/udp --permanentsudo firewall-cmd --add-port=514/tcp --permanentsudo firewall-cmd --reloadCheck rsyslog/syslog-ng status:
sudo systemctl status rsyslogsudo journalctl -u rsyslog -n 50Enable debug logging in rsyslog:
$DebugLevel 2$DebugFile /var/log/rsyslog-debug.logLogback SyslogAppender not working
Section titled “Logback SyslogAppender not working”Check for XML syntax errors:
# Look for Logback errors in STDOUTsudo journalctl -u mideyeserver6 | grep -i logbackVerify syslog host is reachable:
nc -u syslog.example.com 514 <<< "test message"Check local syslog for clues:
sudo tail -f /var/log/syslogimfile module not loading
Section titled “imfile module not loading”Verify module is available:
rsyslogd -v | grep imfileLoad module explicitly in rsyslog.conf:
module(load="imfile")Related documentation
Section titled “Related documentation”- Overview: Log file locations and paths per platform
- Log Levels: Configure what gets logged before forwarding
- Log Aggregators: Alternative to syslog for centralized logging
- Console & journald: Forward systemd journal to syslog