Logs

sfp server logs

View logs for a tenant's services

sfp server logs

Display and monitor logs from various services running for a tenant.

USAGE
  $ sfp server logs -t <value> [--json] [-s
    app|critical-worker|normal-worker|batch-worker] [-f] [--tail <value>] [-g
    <value>...] [--loglevel
    trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
    [--passphrase <value> [--identity-file <value> --ssh-connection <value>]]

FLAGS
  -t, --tenant=<value>              (required) Name of the tenant
  -s, --service=<option>            Specific service to show logs for
                                    <options: app|critical-worker|normal-worker|batch-worker>
  -f, --follow                      Follow log output in real-time
  --tail=<value>                    [default: 100] Number of lines to show from the end of logs
  
  SSH OPTIONS
  --ssh-connection=<value>          SSH connection string in the format user@host[:port]
  --identity-file=<value>           Path to SSH private key file
  --passphrase=<value>              Passphrase for the SSH private key if required
  
  OTHER OPTIONS
  --json                            Format output as json
  -g, --logsgroupsymbol=<value>...  Symbol used by CICD platform to group/collapse logs
  --loglevel=<option>               [default: info] logging level for this command invocation
                                    <options: trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL>

DESCRIPTION
  View logs for a tenant's services

  This command allows you to:
  - View logs from all services or a specific service
  - Follow logs in real-time
  - Retrieve historical logs
  - Filter by service type

  Available services:
  - app: Main API server logs
  - critical-worker: Critical queue worker logs
  - normal-worker: Normal queue worker logs
  - batch-worker: Batch queue worker logs

EXAMPLES
  $ sfp server logs --tenant my-app

  $ sfp server logs --tenant my-app --service app

  $ sfp server logs --tenant my-app --service normal-worker --tail 200

  $ sfp server logs --tenant my-app --follow

  $ sfp server logs --tenant my-app --ssh-connection user@remote-host --identity-file ~/.ssh/id_rsa

Viewing Logs

All Services

View recent logs from all services:

Specific Service

View logs from a specific service:

Historical Logs

View more historical logs:

Real-time Monitoring

Follow Mode

Monitor logs in real-time as they are generated:

Follow specific service:

Log Format Examples

Standard Output

JSON Output

Remote Server Logs

View logs from a remote server:

Troubleshooting with Logs

Error Investigation

Performance Analysis

Log Management Scripts

Log Export

Error Monitoring

Best Practices

  1. Regular Log Review: Check logs daily for errors and warnings

  2. Use Follow Mode for Debugging: Monitor in real-time when troubleshooting

  3. Export Critical Logs: Save logs before updates or maintenance

  4. Set Up Log Aggregation: Forward logs to centralized logging systems

Note: Logs are rotated automatically to prevent disk space issues. Older logs may not be available.

Tip: Use --follow mode combined with grep for real-time filtering of specific log patterns.

Last updated