Logging & Metrics
Settings for bouncer logging and Prometheus metrics.
Logging
Section titled “Logging”logging.level Optional
Section titled “logging.level ”Env: LOG_LEVEL · Default: info
Log verbosity level:
| Level | Description |
|---|---|
debug | Detailed information for debugging (noisy) |
info | Normal operation messages |
warn | Warning conditions |
error | Error conditions only |
logging: level: "debug" # Useful for troubleshootinglogging.format Optional
Section titled “logging.format ”Env: LOG_FORMAT · Default: text
Log output format:
text— human-readable, colored output (best for console/journalctl)json— structured JSON (best for log aggregation systems)
logging.file Optional
Section titled “logging.file ”Env: LOG_FILE · Default: — (stdout)
Path to a log file. When empty, logs are written to stdout only. When set, logs are written to both stdout and the specified file.
logging: file: "/var/log/cs-routeros-bouncer.log"Prometheus Metrics
Section titled “Prometheus Metrics”metrics.enabled Optional
Section titled “metrics.enabled ”Env: METRICS_ENABLED · Default: false
Enable the Prometheus metrics endpoint. When enabled, the bouncer exposes metrics at /metrics and a health check at /health.
metrics.listen_addr Optional
Section titled “metrics.listen_addr ”Env: METRICS_ADDR · Default: 0.0.0.0
Listen address for the metrics HTTP server.
metrics.listen_port Optional
Section titled “metrics.listen_port ”Env: METRICS_PORT · Default: 2112
Listen port for the metrics HTTP server.
metrics: enabled: true listen_addr: "0.0.0.0" listen_port: 2112metrics.routeros_poll_interval Optional
Section titled “metrics.routeros_poll_interval ”Env: METRICS_ROUTEROS_POLL_INTERVAL · Default: 30s
How often to poll RouterOS for system metrics (CPU load, memory, temperature). Set to 0 to disable system metrics collection.
metrics: routeros_poll_interval: "30s"metrics.track_processed Advanced
Section titled “metrics.track_processed ”Env: METRICS_TRACK_PROCESSED · Default: true
Enable tracking of processed (non-blocked) traffic through the firewall. When enabled, the bouncer creates passthrough counting rules on RouterOS to measure all traffic passing through monitored chains and reports the data to both Prometheus and LAPI.
Set to false to disable processed traffic tracking, which avoids creating additional rules on the router and reduces metric overhead.
metrics: track_processed: true