Collecting logs via Journald
Integration with the systemd journal for collecting structured logs from Linux systems. LogDoc reads journald entries in real time, preserving all metadata: priority, unit, PID and custom fields.
logdoc-journald.conf
[journald] # Enable collection from journald enabled = true # Filter by unit units = nginx.service, postgresql.service, myapp.service # Minimum priority (0-7, where 0 = emerg, 7 = debug) min_priority = 6 # Persist the cursor to resume after restart persist_cursor = true cursor_file = /var/lib/logdoc/journald.cursor
Verify the connection
# Check collector status $ logdoc-ctl status journald # Send a test message $ logger -t myapp 'Test message for LogDoc' # View the latest collected entries $ logdoc-ctl tail --source journald --limit 10
Highlights
•Automatic cursor position persistence to resume after restart
•Filtering by systemd unit, priority and arbitrary fields
•Support for structured journald fields (MESSAGE_ID, CODE_FILE and more)