When I issue journalctl I get a massive log of all system services, but where is all this information stored?

share|improve this question
up vote 20 down vote accepted

From man systemd-journald:

FILES
       /etc/systemd/journald.conf
           Configure systemd-journald behavior. See journald.conf(5).

       /run/log/journal/machine-id/*.journal,
       /run/log/journal/machine-id/*.journal~,
       /var/log/journal/machine-id/*.journal,
       /var/log/journal/machine-id/*.journal~
           systemd-journald writes entries to files in
           /run/log/journal/machine-id/ or /var/log/journal/machine-id/ with
           the ".journal" suffix. If the daemon is stopped uncleanly, or if
           the files are found to be corrupted, they are renamed using the
           ".journal~" suffix, and systemd-journald starts writing to a new
           file.  /run is used when /var/log/journal is not available, or when
           Storage=volatile is set in the journald.conf(5) configuration file.

And as man journalctl says:

journalctl may be used to query the contents of the systemd(1) journal
as written by systemd-journald.service(8).

These logs are managed by the systemd-journald service, so a more appropriate term would be "journald logs".

share|improve this answer
    
Thanks for the correction, but suppose a noob like me will search for that too so I guess it is better left this way. A follow-up question - are these logs safe to delete? – php_nub_qq Dec 26 '16 at 15:57
2  
Well, logs are safe to delete unless you need the information from them later on. – muru Dec 26 '16 at 16:01
    
Note that by default, systemd will delete older logs as they approach a certain percentage of disk space used. – mattdm Dec 26 '16 at 16:59

Note, however that Ubuntu is not using persistent journald log file by default.

Only the volatile /run/log/journal/<machine-id>/*.journal[~] is kept until the next boot. Alll is lost at each reboot.

You may see a list of boot retained in the log with

journalctl --list-boot

The logs are still kept in text file under /var/log; unless you have activated the use of persitent journald log by creating /var/log/journal directory

share|improve this answer
5  
However, the journald log arguably should be persistent by default. [bug #1618188] (bugs.launchpad.net/ubuntu/+source/systemd/+bug/1618188) has been opened to track the progress of this change. Check there for the latest status. – Mark Stosberg Dec 26 '16 at 22:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.