its-network/docs/space/srv-acraze/logging.md
Xiretza 9376f77c0d Fix markdown formatting
mkdocs requires 4-space indents for nested lists and explicit hyperlinks
2025-03-16 12:52:11 +00:00

1.2 KiB

Centralized logging

arlog.srv.it-syndikat.org runs systemd-journal-remote.

Client configuration

Assuming the client is named clientsrv:

  1. On debian, install systemd-journal-remote.
  2. In /etc/systemd/journal-upload.conf:
    [Upload]
    URL=https://arlog.srv.it-syndikat.org
    ServerKeyFile=/run/credentials/systemd-journal-upload.service/privkey
    ServerCertificateFile=/etc/systemd/journal-upload-cert.pem
    TrustedCertificateFile=/etc/ssl/certs/ca-certificates.crt
    
  3. systemctl edit systemd-journal-upload.service, add:
    [Service]
    LoadCredential=privkey:/etc/systemd/journal-upload-privkey.pem
    
  4. On arlog.srv.it-syndikat.org:
    1. Run sudo /usr/local/bin/generate_client_cert clientsrv /tmp/journal-upload-privkey.pem
    2. Copy /etc/systemd/journal-remote-client-certs/clientsrv.pem to /etc/systemd/journal-upload-cert.pem on clientsrv
    3. Copy /tmp/journal-upload-privkey.pem to /etc/systemd/journal-upload-privkey.pem on clientsrv (ensure chmod 600)
  5. systemctl enable --now systemd-journal-upload.service
  6. Optionally reduce local journal retention - in /etc/systemd/journald.conf:
    [Journal]
    MaxRetentionSec=2h
    MaxFileSec=1h