How to manage files in /var/log/journal/ in ubuntu 18.04?
Asked Answered
D

1

5

I want to learn about and manage the directory /var/log/journal/ in ubuntu 18.04

  • What data is logged to it and when?
  • Is there any issue in deleting all files from that directory?
  • Is there any way to set delete old data (eg. 1 month)?
Dolabriform answered 25/9, 2020 at 6:2 Comment(1)
Refer this link to solve the issue - askubuntu.com/questions/1238214/big-var-log-journalTransmittal
D
8

I have learned it in weak end - adding a short note here

  • journald is - systemd’s logging service

  • Journalctl is a utility for querying and displaying logs from journald

  • the logs are stored in /var/log/journal/ (except, when we delete the directory)

  • we can manage the size and etc in /etc/systemd/journald.conf

  • useful journalctl commands

    • journalctl - to view all logs
    • journalctl --disk-usage - to check disk usage
    • journalctl --since "2020-09-24 00:00:00" --until "2020-09-24 23:59:59" - to view logs in between this time range
    • journalctl -f - tail the logs
Dolabriform answered 28/9, 2020 at 4:58 Comment(2)
link to the manpage of journald.confConatus
unix.stackexchange.com/questions/130786/…Transmittal

© 2022 - 2024 — McMap. All rights reserved.