Skip to content

Audit log

A separate log stream that records every command run: who ran it, which button, the exit code, and how long it took. Configured under logging in your config file.

This is the record you check later when you want to know who restarted a service at three in the morning, or whether last night's backup button really did finish. Because it is its own stream, you can keep it after the ordinary application log has rotated away.

Each run adds one line, and between them they answer four questions:

Question What the line tells you
Who? The Telegram account that tapped the button
What? The button they used
Did it work? The exit code the command returned
How long? The time the command took to finish

Writing the audit log to its own file

logging section of config.yaml
logging:
  logs:
    audit:
      level: info
      format: json
      output:
        - output: file
          file: /var/log/telegram-commander/audit.log

Configuration

For the full logging schema and supported outputs, see Configuration → logging.