'Log File Viewer' keeping too many logs - how to configure?

10 réponses [Dernière contribution]
Sunny Day
Hors ligne
A rejoint: 01/05/2023

Hi all,

I'm asking for someone else whose computer has slowed down with hundreds of files in 'Log File Viewer'.

I'm not sure how to help clear up the excessive number of logs, nor on how to configure it, so it doesn't save everything. My own 'Log File Viewer' doesn't have this problem, but I can't explain why the difference.

Hope my question makes sense, I am a bit at loss even on how to ask for help with this.

As usual, many thanks for any help.

Magic Banana

I am a member!

I am a translator!

Hors ligne
A rejoint: 07/24/2010

Reading what is repeated in the log is a good idea. It may be be a problem worth solving (not only to have the logs take less space).

Sunny Day
Hors ligne
A rejoint: 01/05/2023

Yes, I agree Magic Banana! Any suggestion to simplify the process (as in 1,2,3 :) would be greatly appreciated

Magic Banana

I am a member!

I am a translator!

Hors ligne
A rejoint: 07/24/2010

Just skim the (recent) log and see if some lines are repeated over and over. It is probably the case. If you do not understand them, you can copy them in reply to this post.

Sunny Day
Hors ligne
A rejoint: 01/05/2023

Oh, I see what you mean. I understand, but that is not the problem.

The problem is the amount of days, weeks, even months of logs that have added up to a point that it takes a looooooong while for Log File Viewer to load.

It's very unusual, at least in my experience. In my computer, Log File Viewer opens instantly, as it has few days of files being loaded.

Magic Banana

I am a member!

I am a translator!

Hors ligne
A rejoint: 07/24/2010

OK. To only keep the last GB of log, execute in a terminal:
$ sudo journalctl --vacuum-size=1G
Instead of a size, you can specify a time with --vacuum-time.

Sunny Day
Hors ligne
A rejoint: 01/05/2023

Thank you Magic Banana!! This is so helpful!

$ sudo journalctl --vacuum-size=1G

How do we specify time with --vacuum-time? If we want to keep one week of logs, for example.

Will the excess of extra months of saved files be removed automatically?

Or should we delete them manually? If so, how to do it safely? (It is not my computer and I want to make sure I don't mess up)

Magic Banana

I am a member!

I am a translator!

Hors ligne
A rejoint: 07/24/2010

How do we specify time with --vacuum-time? If we want to keep one week of logs, for example.

That would be:
$ sudo journalctl --vacuum-time 1week

Will the excess of extra months of saved files be removed automatically?

Yes. The command even reports what files in /var/log/journal/* are deleted and the disk space freed.

Those commands are for immediate removal. If you want the journal to always stay under a given size, you need to define SystemMaxUse in /etc/systemd/journald.conf, as grosbidepoilu told you. Administrator privileges are necessary to modify that file (here with pluma; choose you favorite text editor):
$ SUDO_EDITOR=pluma sudoedit /etc/systemd/journald.conf

Sunny Day
Hors ligne
A rejoint: 01/05/2023

Briliant! Thank so much Magic Banana!!!

Sunny Day
Hors ligne
A rejoint: 01/05/2023

Magic Banana, I followed all to the letter, but the excess logs were not removed. The Log File Viewer is still taking ages to open, slowly loading the files (going from 3 Sep to today, 3 Nov)

I even executed both commands:

First:
$ sudo journalctl --vacuum-time 1week
Restarted, but saw no change, so executed the other option:
$ sudo journalctl --vacuum-size=1G
Again, no change, all logs are still there!

I am thinking of using BleachBit to delete the excess logs, but want to confirm that this would cause no harm... can you enlighten me please?

Sunny Day
Hors ligne
A rejoint: 01/05/2023

Must add that I am not alone in wanting a system that doesn't network, that has no remote connection at all, a stand alone system.

When I hear this, I wonder why there isn't an option to kill all remote in one go. Or maybe there is a kill switch, but I haven't found it... would love to find it though!

By the way, when you love Trisquel as we do, we want badly to make it work for us too!