| Command Type | Syntax | Description | Example |
|---|---|---|---|
| From Specific Timestamp | journalctl -u gunicorn.service --since "YYYY-MM-DD HH:MM:SS" |
Fetch logs from a specific date and time | journalctl -u gunicorn.service --since "2025-01-15 14:30:00" |
| Last N Hours | journalctl -u gunicorn.service --since "-Nh" |
Retrieve logs from the last N hours | journalctl -u gunicorn.service --since "-2h" |
| Last N Lines | journalctl -u gunicorn.service -n 100 |
Show last 100 log entries | journalctl -u gunicorn.service -n 100 |
| Follow Live Logs | journalctl -u gunicorn.service -f |
Continuously display new log entries | journalctl -u gunicorn.service -f |
-ror--reverse: Display logs in reverse chronological order--no-pager: Output logs directly to terminal-p warning: Filter logs by priority level
journalctl -u gunicorn.service --since "2025-01-01" --until "2025-01-31" -p errThis command retrieves error-level logs for the Gunicorn service throughout January 2025