Skip to content

Console & journald — STDOUT Logging and systemd Integration

In addition to file-based logging, MideyeServer writes log entries to the console (STDOUT). On Linux systems using systemd, console output is automatically captured by the systemd journal (journald), providing centralized access to logs from all services.

Key features:

  • Real-time log streaming with journalctl
  • Structured metadata (service unit, PID, priority)
  • Automatic log rotation and retention
  • Integration with systemd’s logging ecosystem
  • Can be forwarded to remote syslog servers

logback.xml
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>
${FILE_LOG_PATTERN}
</Pattern>
</layout>
</appender>
<!-- Attached at DEBUG level -->
<root level="DEBUG">
<appender-ref ref="STDOUT"/>
</root>

Console output uses the same format as file logs:

%date{yyyy-MM-dd HH:mm:ss.SSSXXX, UTC} %-5level [%thread] %logger{0}: %msg%n

On Linux systems with systemd, view MideyeServer console output:

Terminal window
# View all MideyeServer logs
sudo journalctl -u mideyeserver6
# Follow logs in real-time (like tail -f)
sudo journalctl -u mideyeserver6 -f
# Show only logs from today
sudo journalctl -u mideyeserver6 --since today
# Show logs from the last hour
sudo journalctl -u mideyeserver6 --since "1 hour ago"
# Show logs since boot
sudo journalctl -u mideyeserver6 -b
# Show only ERROR and higher
sudo journalctl -u mideyeserver6 -p err
# Last 100 lines
sudo journalctl -u mideyeserver6 -n 100
# Export to file
sudo journalctl -u mideyeserver6 > mideyeserver-journal.log

journalctl priority filters:

Priorityjournalctl flagLogback level
emerg-p 0N/A
alert-p 1N/A
crit-p 2N/A
err-p 3ERROR
warning-p 4WARN
notice-p 5N/A
info-p 6INFO
debug-p 7DEBUG

Example: Show only WARN and ERROR:

Terminal window
sudo journalctl -u mideyeserver6 -p warning
Terminal window
# Search for specific text
sudo journalctl -u mideyeserver6 | grep "Authentication failed"
# Case-insensitive search
sudo journalctl -u mideyeserver6 | grep -i "error"
# Search with context (3 lines before/after)
sudo journalctl -u mideyeserver6 | grep -C 3 "NullPointerException"
# Filter by date range
sudo journalctl -u mideyeserver6 --since "2026-02-24" --until "2026-02-25"
Terminal window
# All systemd services
sudo journalctl
# All logs since last boot
sudo journalctl -b
# Kernel messages
sudo journalctl -k
# All ERROR messages from any service
sudo journalctl -p err

By default, the systemd journal stores logs in /run/log/journal/ (volatile, cleared on reboot). To persist across reboots:

  1. Check current storage mode

    Terminal window
    sudo journalctl --header | grep "State"
  2. Enable persistent storage

    Terminal window
    sudo mkdir -p /var/log/journal
    sudo systemctl restart systemd-journald
  3. Verify persistent storage

    Terminal window
    sudo journalctl --verify

Configure journal retention in /etc/systemd/journald.conf:

/etc/systemd/journald.conf
[Journal]
# Store journal on disk
Storage=persistent
# Limit total journal size to 1GB
SystemMaxUse=1G
# Each journal file max 100MB
SystemMaxFileSize=100M
# Keep journal data for 30 days
MaxRetentionSec=30d
# Keep at least 100MB free on disk
SystemKeepFree=100M

After editing, restart journald:

Terminal window
sudo systemctl restart systemd-journald
Terminal window
# Show current journal disk usage
sudo journalctl --disk-usage
# Vacuum old logs (force cleanup)
sudo journalctl --vacuum-time=7d # Keep 7 days
sudo journalctl --vacuum-size=500M # Keep 500MB max

Forward all systemd journal entries (including MideyeServer) to a remote syslog server.

/etc/systemd/journald.conf
[Journal]
ForwardToSyslog=yes
MaxLevelSyslog=info
Terminal window
sudo systemctl restart systemd-journald

This sends journal entries to the local syslog daemon (rsyslog/syslog-ng), which then forwards to remote servers using its own configuration (see Syslog).

For direct journal-to-journal forwarding without syslog, use systemd-journal-remote.

On the receiving server:

Terminal window
sudo apt-get install systemd-journal-remote
sudo systemctl enable systemd-journal-remote.socket
sudo systemctl start systemd-journal-remote.socket

On the MideyeServer host:

Terminal window
sudo apt-get install systemd-journal-upload

Configure the upload target:

Terminal window
sudo systemctl edit systemd-journal-upload.service

Add:

[Service]
Environment="SYSTEMD_JOURNAL_UPLOAD_URL=http://remote-server:19532"
Terminal window
sudo systemctl enable systemd-journal-upload
sudo systemctl start systemd-journal-upload

Configure rsyslog to read from the journal and forward:

/etc/rsyslog.d/00-journal.conf
# Load imjournal module
module(load="imjournal"
StateFile="/var/spool/rsyslog/imjournal.state"
RateLimit.Interval="10"
RateLimit.Burst="30000")
# Forward all journal entries
*.* @@remote-syslog.example.com:514
Terminal window
sudo systemctl restart rsyslog

This is the most flexible approach for existing rsyslog infrastructure.


If console logging is not needed (e.g., you only use file logs or forward files to aggregators), disable the STDOUT appender to reduce overhead.

logback.xml
<!-- Comment out STDOUT root logger -->
<!--
<root level="DEBUG">
<appender-ref ref="STDOUT"/>
</root>
-->

Reduce verbosity by increasing the level:

logback.xml
<!-- Only log ERROR to console -->
<root level="ERROR">
<appender-ref ref="STDOUT"/>
</root>

Delete the <appender name="STDOUT"> block and all references to it.


On Windows, console output is typically not visible unless running MideyeServer in non-service mode.

  1. Stop the MideyeServer service

  2. Run MideyeServer from command line

    Terminal window
    cd "C:\Program Files (x86)\Mideye Server 6\bin"
    mideyeserver.exe --console
  3. View console logs in the terminal window

For service-based installations, use the file logs (mideyeserver.log) or Windows Event Log instead (see Windows Event Log).


The systemd journal supports structured logging with key-value pairs. While MideyeServer’s default Logback configuration outputs plain text, the journal adds its own structured metadata.

View structured data:

Terminal window
sudo journalctl -u mideyeserver6 -o json-pretty

Example output:

{
"MESSAGE": "Application 'MideyeServer' is running!",
"PRIORITY": "6",
"SYSLOG_FACILITY": "3",
"SYSLOG_IDENTIFIER": "java",
"_SYSTEMD_UNIT": "mideyeserver6.service",
"_PID": "12345",
"_HOSTNAME": "mideyeserver01"
}

Filter by structured fields:

Terminal window
# Show only logs from specific PID
sudo journalctl _PID=12345
# Show only from specific unit
sudo journalctl _SYSTEMD_UNIT=mideyeserver6.service

Check service configuration:

Terminal window
sudo systemctl status mideyeserver6

Verify StandardOutput and StandardError are set to journal (or not set, which defaults to journal):

/etc/systemd/system/mideyeserver6.service
[Service]
StandardOutput=journal
StandardError=journal

Reload and restart:

Terminal window
sudo systemctl daemon-reload
sudo systemctl restart mideyeserver6

Look for errors in journal output:

Terminal window
sudo journalctl -u mideyeserver6 | grep -i "logback\|appender"

Ensure <root> or specific loggers reference STDOUT:

<root level="INFO">
<appender-ref ref="STDOUT"/>
</root>
Terminal window
# Check disk usage
sudo journalctl --disk-usage
# Vacuum old logs
sudo journalctl --vacuum-size=500M
sudo journalctl --vacuum-time=7d

Set retention limits in journald.conf (see Retention and size limits above).

If console logging causes performance problems:

Increase root level to reduce volume:

<root level="WARN">
<appender-ref ref="STDOUT"/>
</root>

Configure journal rate limiting in journald.conf:

[Journal]
RateLimitIntervalSec=30s
RateLimitBurst=10000

FeatureFile logs (mideyeserver.log)systemd journal
PersistenceDepends on rotation policyDepends on journal config
AccessAny user with file permissionsRoot or users in systemd-journal group
Filteringgrep, awk, text toolsjournalctl with structured filters
RotationLogback configurationAutomatic by journald
ForwardingFile tailing (Filebeat, etc.)ForwardToSyslog, journal-remote
FormatCustomizable (Logback pattern)Plain text + structured metadata
Web UIYes (Log Files page)No (command-line only)

  • Overview: Logback configuration file locations and structure
  • Log Levels: Configure what gets logged to console
  • Syslog: Forward logs to syslog servers (including journal → syslog)
  • Log Aggregators: Modern alternative to syslog for centralized logging