Skip to content

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:

  1. The appender — defines where and how to send logs (server address, port, format)
  2. 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):

logback.xml — add both blocks
<!-- 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.


This page covers three approaches, from simplest to most robust:

MethodTransportReliabilityComplexityBest for
Logback SyslogAppenderUDP onlyStandardLowSimple local syslog
rsyslog imfileTCP, TLS, RELPHighMediumProduction deployments
syslog-ng file sourceTCP, TLSHighMediumExisting syslog-ng setups

MideyeServer’s logback.xml includes a commented-out SyslogAppender configuration. This is the simplest option for local or UDP-based syslog forwarding.

  • UDP only — no TCP or TLS support
  • No buffering — logs may be lost during restarts or network issues
  • Fire-and-forget — no delivery confirmation
  1. Edit logback.xml

    Location: See Overview for platform-specific paths.

  2. 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>
  3. Customize settings

    ParameterDescriptionDefaultRecommendation
    syslogHostHostname or IP of syslog serverlocalhostUse remote server IP for centralized logging
    portUDP port514Standard syslog port (may require firewall rules)
    facilitySyslog facility codeLOCAL0Use LOCAL0LOCAL7 for application logs
    suffixPatternLog message formatISO8601 timestamp + log detailsCustomize 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>
  4. 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>
  5. Save and verify

    Changes take effect automatically within 60 seconds. Check your syslog server to confirm messages are arriving.

FacilityNumeric CodeTypical Use
USER1User-level messages (default)
LOCAL016Local use 0 (custom applications)
LOCAL117Local use 1
LOCAL218Local use 2
LOCAL319Local use 3
LOCAL420Local use 4
LOCAL521Local use 5
LOCAL622Local use 6
LOCAL723Local use 7

The imfile module allows rsyslog to tail log files and forward them to remote syslog servers with TCP, TLS, and reliable message queuing.

  • rsyslog installed on the MideyeServer host (typically included in Linux distributions)
  • rsyslog with imfile module (standard in rsyslog 8.0+)
  1. Create rsyslog configuration file

    Terminal window
    sudo nano /etc/rsyslog.d/30-mideyeserver.conf
  2. Add imfile configuration

    /etc/rsyslog.d/30-mideyeserver.conf
    # Load imfile module (if not already loaded)
    module(load="imfile" PollingInterval="10")
    # MideyeServer main log
    input(type="imfile"
    File="/opt/mideyeserver6/log/mideyeserver.log"
    Tag="mideyeserver"
    Severity="info"
    Facility="local6"
    reopenOnTruncate="on")
    # MideyeServer error log
    input(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
  3. Choose forwarding protocol

    ProtocolSyntaxDescription
    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:514

    Example: 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 TLS
    if $syslogtag contains 'mideyeserver' then @@syslog.example.com:6514
  4. Test configuration syntax

    Terminal window
    sudo rsyslogd -N1

    Look for errors related to your configuration file.

  5. Restart rsyslog

    Terminal window
    sudo systemctl restart rsyslog
    sudo systemctl status rsyslog
  6. Verify forwarding

    Check your remote syslog server to confirm MideyeServer logs are arriving with the mideyeserver tag.

Advanced: local filtering before forwarding

Section titled “Advanced: local filtering before forwarding”

Filter log events before sending to reduce network traffic:

/etc/rsyslog.d/30-mideyeserver.conf
# Forward only ERROR and WARN messages
if $syslogtag contains 'mideyeserver' and ($syslogseverity <= 4) then @@syslog.example.com:514
# Forward INFO and higher
if $syslogtag contains 'mideyeserver' and ($syslogseverity <= 6) then @@syslog.example.com:514

Syslog severity mapping:

PrioritySeverityNumeric
Emergencyemerg0
Alertalert1
Criticalcrit2
Errorerr3
Warningwarning4
Noticenotice5
Informationalinfo6
Debugdebug7

Advanced: queue configuration for reliability

Section titled “Advanced: queue configuration for reliability”

Add message queuing to handle network outages:

/etc/rsyslog.d/30-mideyeserver.conf
# Create a disk-assisted queue for reliable forwarding
$ActionQueueType LinkedList
$ActionQueueFileName mideyeserver_queue
$ActionQueueMaxDiskSpace 1g
$ActionQueueSaveOnShutdown on
$ActionQueueTimeoutEnqueue 0
$ActionResumeRetryCount -1
# Forward with queue
if $syslogtag contains 'mideyeserver' then @@syslog.example.com:514

If you use syslog-ng instead of rsyslog, configure a file source to tail MideyeServer logs.

  1. Create syslog-ng configuration file

    Terminal window
    sudo nano /etc/syslog-ng/conf.d/mideyeserver.conf
  2. Add file source and destination

    /etc/syslog-ng/conf.d/mideyeserver.conf
    # Source: tail MideyeServer log files
    source 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 destination
    log {
    source(s_mideyeserver);
    source(s_mideyeserver_error);
    destination(d_remote_syslog);
    };
  3. 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);
    };
  4. Test and restart

    Terminal window
    # Test configuration
    sudo syslog-ng -s
    # Restart syslog-ng
    sudo systemctl restart syslog-ng
    sudo systemctl status syslog-ng

  1. 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).

  2. Check local syslog

    Terminal window
    sudo tail -f /var/log/syslog | grep mideyeserver
  1. Watch incoming logs

    Terminal window
    sudo tail -f /var/log/syslog | grep mideyeserver
  2. Check for network connectivity

    Terminal window
    # Test UDP syslog port
    nc -vu syslog.example.com 514
    # Test TCP syslog port
    nc -v syslog.example.com 514

Check network connectivity:

Terminal window
ping syslog.example.com
telnet syslog.example.com 514

Check firewall rules:

Terminal window
# Allow outbound UDP/TCP 514
sudo firewall-cmd --add-port=514/udp --permanent
sudo firewall-cmd --add-port=514/tcp --permanent
sudo firewall-cmd --reload

Check rsyslog/syslog-ng status:

Terminal window
sudo systemctl status rsyslog
sudo journalctl -u rsyslog -n 50

Enable debug logging in rsyslog:

/etc/rsyslog.d/30-mideyeserver.conf
$DebugLevel 2
$DebugFile /var/log/rsyslog-debug.log

Check for XML syntax errors:

Terminal window
# Look for Logback errors in STDOUT
sudo journalctl -u mideyeserver6 | grep -i logback

Verify syslog host is reachable:

Terminal window
nc -u syslog.example.com 514 <<< "test message"

Check local syslog for clues:

Terminal window
sudo tail -f /var/log/syslog

Verify module is available:

Terminal window
rsyslogd -v | grep imfile

Load module explicitly in rsyslog.conf:

/etc/rsyslog.conf
module(load="imfile")