🎁 New User? Get 20% off your first purchase with code NEWUSER20 Register Now β†’
Menu

Categories

Linux Log Management with journalctl and rsyslog: Troubleshooting Like a Pro

Linux Log Management with journalctl and rsyslog: Troubleshooting Like a Pro

Effective log management is key to troubleshooting.

journalctl Essentials

journalctl -f
journalctl -u nginx
journalctl -p err
journalctl --since "1 hour ago"
journalctl -k

Advanced Queries

journalctl _PID=1234
journalctl -b 0
journalctl -u nginx --output json-pretty
journalctl -u nginx --grep="404|500"

rsyslog

auth,authpriv.*          /var/log/auth.log
*.*;auth,authpriv.none   /var/log/syslog
*.err                    /var/log/errors.log
*.* @@logserver:514

Log Rotation

/var/log/nginx/*.log {
    daily
    rotate 30
    compress
    delaycompress
}

Troubleshooting Flow

journalctl -p err --since "10 minutes ago"
journalctl -k | grep -i "oom"
systemctl --failed

Master monitoring with our Monitoring eBook collection.

Share this article:
Dargslan Editorial Team (Dargslan)
About the Author

Dargslan Editorial Team (Dargslan)

Collective of Software Developers, System Administrators, DevOps Engineers, and IT Authors

Dargslan is an independent technology publishing collective formed by experienced software developers, system administrators, and IT specialists.

The Dargslan editorial team works collaboratively to create practical, hands-on technology books focused on real-world use cases. Each publication is developed, reviewed, and...

Programming Languages Linux Administration Web Development Cybersecurity Networking

Stay Updated

Subscribe to our newsletter for the latest tutorials, tips, and exclusive offers.