Welcome to the Pacman bug tracker. Please search the current bugs and feature requests before filing a new one! Use advanced search and select "Search in Comments".

* Please select the correct category and version.
* Write a descriptive summary, background info, and provide a reproducible test case whenever possible.

FS#11272 - Add logrotate script for pacman.log?

Attached to Project: Pacman
Opened by David Rosenstrauch (darose) - Wednesday, 20 August 2008, 19:51 GMT
Last edited by Dan McGee (toofishes) - Wednesday, 09 September 2009, 11:47 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Dan McGee (toofishes)
Architecture All
Severity Low
Priority Normal
Reported Version None
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


Perhaps the pacman package should include a logrotate script for pacman.log?

This was discussed a bit on the Arch general mailing list (see: and was a bit of a controversial idea, so perhaps it's not a good idea.

Nevertheless, I figured we ought to at least get the idea into a bug report, and capture the resulting discussion of pros/cons - and the final decision - here.
This task depends upon

Closed by  Dan McGee (toofishes)
Wednesday, 09 September 2009, 11:47 GMT
Reason for closing:  Won't implement
Additional comments about closing:  Please add your own if you want one.
Comment by Xavier (shining) - Wednesday, 20 August 2008, 20:44 GMT
pacman.log is very useful for many things :
1) information about the system like its age
2) retrieving the list of installed packages for restoring a lost local database (it happened more than once)
3) debugging purpose

So *if* a logrotate script is added to pacman, it should be disabled by default, in my opinion.
Any user who really knows what he is doing can then more easily enable it.

And even if it is disabled by default, I would also prefer if this script compressed the old logs rather than deleting them.
It would still save space while keeping all the information (which would be slightly less practical to retrieve, but well).
Comment by Gavin Bisesi (Daenyth) - Thursday, 21 August 2008, 18:36 GMT
I'm very against it, and if it is implemented, then as Xavier said: compress, disabled by default. I'd also like it to only rotate if the filesize reaches a certain point.

FWIW, my arch intall on my home server/desktop is about 14 months old, and my pacman.log is less than 600Kb
Comment by Dan McGee (toofishes) - Thursday, 21 August 2008, 22:01 GMT
I believe I've already expressed my negative vote for this on the ML. I'm not going to close it, but you'll be hard to see me as the pacman maintainer implement this one.
Comment by David Rosenstrauch (darose) - Thursday, 21 August 2008, 22:10 GMT
I'm fine if this gets rejected/closed. Seems like it'd be a good idea, as all our other log files get rotated. But I don't really feel that strongly either way.

But I opened this as a bug so we can get a decision written down in the bug tracker, as opposed to the mailing list discussion, which we left hanging with no final resolution.
Comment by Allan McRae (Allan) - Friday, 22 August 2008, 06:07 GMT
This is what I have had floating around in my head for a while. A script for pacman-contrib which does:
1) Removes all post-install messages from the log
2) Removes all "synchronizing package lists" / "starting full system upgrade" messages
3) Finds packages that have been uninstalled and removes all traces of them between the respective install/remove lines
4) Perhaps removes all but the last upgrade message for packages the are still installed
5) Removes warnings about pacsave/pacnew files
6) Is configurable to not touch the last n days of the log
7) Can make a list of currently installed according to the log

This would make logs smaller but not remove essential information. So.... who is going to write it for me? :)
Comment by Xavier (shining) - Friday, 22 August 2008, 06:22 GMT
Implementing what Dan said would make all this much easier :
But then, this would only affect the new logs, not the old ones.