Bug 1695720
Summary: | dnf logs excessively verbosely by default, cannot be configured, certain operations (e.g. reposync) lead to huge logs occupying excessive filesystem space | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 8 | Reporter: | Adam Williamson <awilliam> |
Component: | dnf | Assignee: | Lukáš Hrázký <lhrazky> |
Status: | CLOSED ERRATA | QA Contact: | Jan Blazek <jblazek> |
Severity: | high | Docs Contact: | |
Priority: | high | ||
Version: | 8.0 | CC: | adam.winberg, dmach, fweimer, james.antill, jberan, jwakely, ksrot, kwalker, lhrazky, redhatbugs, sudo, tbowling |
Target Milestone: | rc | Keywords: | Triaged |
Target Release: | 8.0 | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | dnf-4.2.6-1.el8 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2019-11-05 22:21:40 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | 1681084 | ||
Bug Blocks: | 1702690 |
Description
Adam Williamson
2019-04-03 16:50:26 UTC
I confirm that the problem is there. The log keeps growing and is not rotated. There is /etc/logrotate.d/dnf configuration for logrotate provided by dnf-data package, but it's not used because logrotate doesn't seem to be installed by default. Possible workarounds: - install logrotate - this will enable weekly rotations - it doesn't solve log flooded with messages - replace log files with symlinks to /dev/null - completely turns logging off Long-term solution: - reduce logging verbosity (especially /var/log/dnf.librepo.log) - use RotatingFileHandler and provide built-in log rotation Whether logrotate is installed by default will depend on the product, I guess. Not sure where RHEL's comps are kept, but in Fedora for e.g. it's in the 'standard' group, meaning *most* installs will get it, but some won't, e.g. a minimal install will not. Also note logrotate doesn't help cases like Magnus' where a single operation produces huge log spam, because the rotation only happens periodically. The plan is following: 1) reduce log verbosity (don't log unnecessary debug messages by default) We're working on this already, see pull-requests: https://github.com/rpm-software-management/dnf/pull/1363 https://github.com/rpm-software-management/libdnf/pull/707 2) implement built-in log rotation in DNF and drop /etc/logrotate.d/dnf We'll scope the work this week and start implementation next week. We'll create a new bug for this work and link it to this one. You could consider doing routine logging to the journal, in which case you get rotation (and various other services) for free? We're staying with log files for now. We don't want to completely change the behavior in a z-stream update. I also want to note that every rpm action (Install/Erase/Upgrade) is logged twice with the exact same message: dnf.rpm.log: 2019-09-19T06:16:13Z SUBDEBUG Installed: emacs-1:26.1-5.el8.x86_64 2019-09-19T06:16:13Z SUBDEBUG Installed: emacs-1:26.1-5.el8.x86_64 2019-09-19T06:16:43Z INFO --- logging initialized --- 2019-09-19T06:16:48Z INFO --- logging initialized --- 2019-09-19T06:16:56Z SUBDEBUG Erase: emacs-1:26.1-5.el8.x86_64 2019-09-19T06:16:56Z SUBDEBUG Erase: emacs-1:26.1-5.el8.x86_64 This makes the logs twice as big as needed and difficult to read. This is from RHEL 8.1 beta with dnf-4.2.6-1.el8.noarch which is supposed to be the 'fixed' version. Also the "logging initialized" message is still there which for me seem like really redundant information. Do I have to do something to get the less verbose logging to take effect? This bug has addressed reducing verbosity of dnf.librepo.log and hawkey.log. I have filed separate bug 1753970 for the duplicate entries in dnf.rpm.log. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2019:3583 |