Skip to main content

Logs

systemg writes internal operational logs and captures service stdout/stderr by default.

What’s logged

  • Service lifecycle (start, stop, restart, crash)
  • Cron job execution
  • Configuration changes
  • Supervisor events

Location

~/.local/share/systemg/logs/supervisor.log (user mode) /var/log/systemg/supervisor.log (system mode) Service output is isolated by project:
  • ~/.local/share/systemg/logs/{project}/{service}.log (user mode)
  • /var/log/systemg/{project}/{service}.log (system mode)
By default, systemg pipes each managed service’s stdout and stderr into reader threads, then writes both streams through one per-service writer into {service}.log. sysg logs reads that stored file; it does not attach to the original process streams.
Info: The default service log is stacked in capture order. Each line gets a systemg UTC capture timestamp plus a stream label, such as stdout or stderr, so sysg logs --kind stderr can filter lines without needing a second stderr file.

Service output configuration

Default log size cap. Each service’s active log file rotates at 10 MB (max_bytes, 10485760 bytes), and systemg keeps 5 rotated files (max_files) per log. So a single service’s captured output is bounded to roughly 60 MB on disk (1 active + 5 rotated) before the oldest is dropped. Raise or lower these with a logs block; set sink: none to capture nothing.
Use the top-level logs block to set defaults for all services:
Use a service-level logs block to override the global defaults:
Supported sinks:
  • file - Capture stdout/stderr and write systemg-managed log files.
  • none - Discard stdout/stderr without creating log-writer threads or files.
max_bytes controls active file rotation for the file sink. max_files controls how many numbered rotated files are retained. Set sink: none for high-output services when another logging pipeline is already responsible for collection.

View logs

Log levels

Set verbosity when starting:
Levels: trace (5), debug (4), info (3), warn (2), error (1), off (0)

Log format

Format: [TIMESTAMP] [LEVEL] [MODULE]: [MESSAGE]

Common messages

Service events

Cron events

Supervisor events

Supervisor log rotation

The supervisor log uses the supervisor.xml log defaults: a 10 MB active-file limit and five rotated files unless changed by the operator. Services can override those defaults in their project manifest. No external rotator is required.
The system installer also writes /etc/logrotate.d/systemg with copytruncate. Do not rename an active supervisor log by hand: an open writer can continue writing to the renamed file.

Troubleshooting

Log file missing
  • Check systemg has started
  • Verify directory exists
Empty logs
  • Try --log-level debug
  • Check services are running
Large log files
  • Configure service log rotation with logs.max_bytes and logs.max_files
  • Prune rotated backups with sysg logs --prune --max-size <size> or --max-age <age>
  • Reduce log level

See also

  • logs - View service output
  • status - Check service health