Skip to content

Latest commit

 

History

History
29 lines (19 loc) · 1.23 KB

File metadata and controls

29 lines (19 loc) · 1.23 KB

Journalctl Gunicorn Log Retrieval Commands

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

Advanced Filtering Options

Additional Useful Flags

  • -r or --reverse: Display logs in reverse chronological order
  • --no-pager: Output logs directly to terminal
  • -p warning: Filter logs by priority level

Complex Filtering Example

journalctl -u gunicorn.service --since "2025-01-01" --until "2025-01-31" -p err

This command retrieves error-level logs for the Gunicorn service throughout January 2025