Logging and tracing

Configure MinIO Sidekick to log events and trace HTTP requests for debugging and monitoring.

Event logging

Enable event logging for backend status changes using --log:

sidekick --log --health-path=/ready http://backend1:8000 http://backend2:8000

Sidekick logs when backends transition between healthy and unhealthy states, including downtime duration and error messages. Logs write to standard output by default.

JSON output

Format logs as JSON for structured logging systems using --json:

sidekick --log --json --health-path=/ready http://backend1:8000 http://backend2:8000

Each log entry becomes a JSON object with fields for timestamp, endpoint, status, and error details. This format integrates with log aggregation systems like Elasticsearch or Splunk.

Request tracing

Enable request tracing to log all HTTP requests and responses using --trace:

sidekick --trace all --health-path=/ready http://backend1:8000 http://backend2:8000

The trace level controls which requests are logged:

  • all - Trace all requests including health checks
  • application - Trace application requests only, excluding health checks
  • minio - Trace MinIO-specific API requests

Verbose tracing

Add detailed request and response information using --debug:

sidekick --trace all --debug --health-path=/ready http://backend1:8000 http://backend2:8000

Debug mode includes request headers, response headers, and timing information in trace output. This generates substantial log volume and should be used only for troubleshooting.

Error filtering

Filter trace output to show only failed requests using --errors:

sidekick --trace all --errors --health-path=/ready http://backend1:8000 http://backend2:8000

Sidekick logs only requests that return error status codes (4xx and 5xx). Successful requests do not appear in the output. Combine with --status-code to filter specific status codes:

sidekick --trace all --status-code 503 --status-code 504 --health-path=/ready http://backend1:8000

Quiet mode

Suppress all console output using --quiet:

sidekick --quiet --health-path=/ready http://backend1:8000 http://backend2:8000

Quiet mode disables logging and tracing regardless of other flags. Sidekick runs silently except for fatal errors. Use this mode when running as a background service with external monitoring.