• Home
  • About Us
  • Contact
  • Privacy Policy

LinuxAdmin.io

  • Home
  • Tutorials
    • System Administration
    • Linux Tutorials
    • Web Hosting
    • WordPress
    • Virtualization
    • Troubleshooting
    • OpenStack

Journalctl Introduction and Examples

Journalctl sytemd output

journalctl was added into the  systemd release of CentOS 7 and has been part of Fedora since 17. It is a logging system for querying and printing messages form the journal. It can be used in with or replacing older logging services like rsyslogd. Journalct also uses highlighting for high priority messages in red and bold for lines with notice and warning priorites. All data is shown when searching, including rotated logs.

Boot messages

Show boot messages:

journalctl -b

Show the last boot message:

journalctl -b -1

List boots of the system:

journalctl --list-boots

Type searches

Show error messages:

journalctl -p err

Show critical messages:

journalctl -p crit

Show messages by a specific user:

journalct -u httpd

Show messages  relating to a specific disk:

journalctl /dev/sda

Time based searches

Show messages since yesterday:

journalctl --since yesterday

Show messages until a certain date & time:

journalctl --until "2017-5-03 11:59:59"

Show messages between two times:

journalctl --since 04:400 --until 10:59

Show last 20 messages:

journalctl -n 20

Live output

Tail the logs:

journalctl -f

Get live output from a specific service:

journalctl -u mysql.service -f

Filtering output

Show journalctl metadata:

journalctl -o verbose

 

Creating persistant storage for journalctl

If you would like create persistant storage for journalctl do the following:

mkdir -p /var/log/journal

then restart journald:

systemctl restart systemd-journald
Apr 20, 2017LinuxAdmin.io
0 0 vote
Article Rating
PHP 5.2 in cPanel easy apache 4using inotify-tools to trigger events
You Might Also Like
 
Bridged Networking Setup For KVM Virtualization
 
mod_auth_token Installation In Apache
Subscribe
Notify of
guest
guest
0 Comments
Inline Feedbacks
View all comments
6 years ago Troubleshooting linux, sysadmin, systemd1,658
Recent Posts
  • Laravel Installation Guide For CentOS
  • Openstack Services Explanation And Overview
  • OSSEC Intrusion Detection Installation On Centos 7
  • Configure ProFTPd for SFTP on CentOS
  • How To Check And Repair MyISAM Tables In MySQL
Most Commented
Hot Clone Linux Server with Rsync
Hot Clone A CentOS Server With Rsync
14 Comments
ngx_cache_purge module
Install The ngx_cache_purge Module In Nginx
8 Comments
piwik-nginx
Piwik Analytics on Nginx
8 Comments
Tags
linuxcentosLinux Performance Tuningsysadminkvmnetworkingmemcachedanalyticssystemd
About

We love Linux and are dedicated to creating Linux administration tutorials for System Administrators since 2016.

Most Viewed
Default Gateway
How To Configure A Default Gateway on CentOS
63,002 views
Zend Opcache
Setup and Optimize Zend OpCache
46,714 views
Install ffmpeg
FFMpeg Install On CentOS 7
20,912 views
Archives
Email subscription

Sign up for our newsletter to receive the latest news and event postings.

2018 © LinuxAdmin.io
wpDiscuz