Bug 2180110

Summary: cephadm: reduce spam to cephadm.log
Product: [Red Hat Storage] Red Hat Ceph Storage Reporter: Adam King <adking>
Component: CephadmAssignee: Adam King <adking>
Status: CLOSED ERRATA QA Contact: Mohit Bisht <mobisht>
Severity: high Docs Contact: Akash Raj <akraj>
Priority: unspecified    
Version: 6.0CC: akraj, cephqe-warriors, vamahaja, vereddy
Target Milestone: ---   
Target Release: 6.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ceph-17.2.6-5.el9cp Doc Type: Enhancement
Doc Text:
.All the Cephadm logs are no longer logged into `cephadm.log` when `--verbose` is not passed Previously, some Cephadm commands, such as `gather-facts`, would spam the log with massive amounts of command output every time they were run. In some cases, it was once per minute. With this release, in Cephadm, all the logs are no longer logged into `cephadm.log` when `--verbose` is not passed. The `cephadm.log` is now easier to read since most of the spam previously written is no longer present.
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-06-15 09:16:51 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: 2180567    
Bug Blocks: 2192813    

Description Adam King 2023-03-20 18:07:45 UTC
Description of problem:

cephadm.log is getting filled with a bunch of messages that won't be useful in 99.9% of situations and make it hard to read the log. For example, gather-facts, which runs every minute, logs

2022-07-12 15:07:50,013 7f737ba12b80 DEBUG --------------------------------------------------------------------------------
cephadm ['gather-facts']
2022-07-12 15:07:50,060 7f737ba12b80 DEBUG /bin/podman: 4.0.2
2022-07-12 15:07:50,113 7f737ba12b80 DEBUG sestatus: SELinux status:                 enabled
2022-07-12 15:07:50,113 7f737ba12b80 DEBUG sestatus: SELinuxfs mount:                /sys/fs/selinux
2022-07-12 15:07:50,113 7f737ba12b80 DEBUG sestatus: SELinux root directory:         /etc/selinux
2022-07-12 15:07:50,113 7f737ba12b80 DEBUG sestatus: Loaded policy name:             targeted
2022-07-12 15:07:50,113 7f737ba12b80 DEBUG sestatus: Current mode:                   permissive
2022-07-12 15:07:50,113 7f737ba12b80 DEBUG sestatus: Mode from config file:          permissive
2022-07-12 15:07:50,113 7f737ba12b80 DEBUG sestatus: Policy MLS status:              enabled
2022-07-12 15:07:50,114 7f737ba12b80 DEBUG sestatus: Policy deny_unknown status:     allowed
2022-07-12 15:07:50,114 7f737ba12b80 DEBUG sestatus: Memory protection checking:     actual (secure)
2022-07-12 15:07:50,114 7f737ba12b80 DEBUG sestatus: Max kernel policy version:      33
2022-07-12 15:07:50,117 7f737ba12b80 DEBUG sestatus: SELinux status:                 enabled
2022-07-12 15:07:50,117 7f737ba12b80 DEBUG sestatus: SELinuxfs mount:                /sys/fs/selinux
2022-07-12 15:07:50,117 7f737ba12b80 DEBUG sestatus: SELinux root directory:         /etc/selinux
2022-07-12 15:07:50,117 7f737ba12b80 DEBUG sestatus: Loaded policy name:             targeted
2022-07-12 15:07:50,117 7f737ba12b80 DEBUG sestatus: Current mode:                   permissive
2022-07-12 15:07:50,117 7f737ba12b80 DEBUG sestatus: Mode from config file:          permissive
2022-07-12 15:07:50,117 7f737ba12b80 DEBUG sestatus: Policy MLS status:              enabled
2022-07-12 15:07:50,117 7f737ba12b80 DEBUG sestatus: Policy deny_unknown status:     allowed
2022-07-12 15:07:50,118 7f737ba12b80 DEBUG sestatus: Memory protection checking:     actual (secure)
2022-07-12 15:07:50,118 7f737ba12b80 DEBUG sestatus: Max kernel policy version:      33
2022-07-12 15:07:50,121 7f737ba12b80 DEBUG sestatus: SELinux status:                 enabled
2022-07-12 15:07:50,121 7f737ba12b80 DEBUG sestatus: SELinuxfs mount:                /sys/fs/selinux
2022-07-12 15:07:50,121 7f737ba12b80 DEBUG sestatus: SELinux root directory:         /etc/selinux
2022-07-12 15:07:50,121 7f737ba12b80 DEBUG sestatus: Loaded policy name:             targeted
2022-07-12 15:07:50,121 7f737ba12b80 DEBUG sestatus: Current mode:                   permissive
2022-07-12 15:07:50,122 7f737ba12b80 DEBUG sestatus: Mode from config file:          permissive
2022-07-12 15:07:50,122 7f737ba12b80 DEBUG sestatus: Policy MLS status:              enabled
2022-07-12 15:07:50,122 7f737ba12b80 DEBUG sestatus: Policy deny_unknown status:     allowed
2022-07-12 15:07:50,122 7f737ba12b80 DEBUG sestatus: Memory protection checking:     actual (secure)
2022-07-12 15:07:50,122 7f737ba12b80 DEBUG sestatus: Max kernel policy version:      33
2022-07-12 15:07:50,125 7f737ba12b80 DEBUG sestatus: SELinux status:                 enabled
2022-07-12 15:07:50,125 7f737ba12b80 DEBUG sestatus: SELinuxfs mount:                /sys/fs/selinux
2022-07-12 15:07:50,125 7f737ba12b80 DEBUG sestatus: SELinux root directory:         /etc/selinux
2022-07-12 15:07:50,125 7f737ba12b80 DEBUG sestatus: Loaded policy name:             targeted
2022-07-12 15:07:50,125 7f737ba12b80 DEBUG sestatus: Current mode:                   permissive
2022-07-12 15:07:50,126 7f737ba12b80 DEBUG sestatus: Mode from config file:          permissive
2022-07-12 15:07:50,126 7f737ba12b80 DEBUG sestatus: Policy MLS status:              enabled
2022-07-12 15:07:50,126 7f737ba12b80 DEBUG sestatus: Policy deny_unknown status:     allowed
2022-07-12 15:07:50,126 7f737ba12b80 DEBUG sestatus: Memory protection checking:     actual (secure)
2022-07-12 15:07:50,126 7f737ba12b80 DEBUG sestatus: Max kernel policy version:      33
2022-07-12 15:07:50,129 7f737ba12b80 DEBUG sestatus: SELinux status:                 enabled
2022-07-12 15:07:50,129 7f737ba12b80 DEBUG sestatus: SELinuxfs mount:                /sys/fs/selinux
2022-07-12 15:07:50,129 7f737ba12b80 DEBUG sestatus: SELinux root directory:         /etc/selinux
2022-07-12 15:07:50,129 7f737ba12b80 DEBUG sestatus: Loaded policy name:             targeted
2022-07-12 15:07:50,129 7f737ba12b80 DEBUG sestatus: Current mode:                   permissive
2022-07-12 15:07:50,129 7f737ba12b80 DEBUG sestatus: Mode from config file:          permissive
2022-07-12 15:07:50,129 7f737ba12b80 DEBUG sestatus: Policy MLS status:              enabled
2022-07-12 15:07:50,129 7f737ba12b80 DEBUG sestatus: Policy deny_unknown status:     allowed
2022-07-12 15:07:50,129 7f737ba12b80 DEBUG sestatus: Memory protection checking:     actual (secure)
2022-07-12 15:07:50,129 7f737ba12b80 DEBUG sestatus: Max kernel policy version:      33
2022-07-12 15:07:50,132 7f737ba12b80 DEBUG sestatus: SELinux status:                 enabled
2022-07-12 15:07:50,132 7f737ba12b80 DEBUG sestatus: SELinuxfs mount:                /sys/fs/selinux
2022-07-12 15:07:50,133 7f737ba12b80 DEBUG sestatus: SELinux root directory:         /etc/selinux
2022-07-12 15:07:50,133 7f737ba12b80 DEBUG sestatus: Loaded policy name:             targeted
2022-07-12 15:07:50,133 7f737ba12b80 DEBUG sestatus: Current mode:                   permissive
2022-07-12 15:07:50,133 7f737ba12b80 DEBUG sestatus: Mode from config file:          permissive
2022-07-12 15:07:50,133 7f737ba12b80 DEBUG sestatus: Policy MLS status:              enabled
2022-07-12 15:07:50,133 7f737ba12b80 DEBUG sestatus: Policy deny_unknown status:     allowed
2022-07-12 15:07:50,133 7f737ba12b80 DEBUG sestatus: Memory protection checking:     actual (secure)
2022-07-12 15:07:50,133 7f737ba12b80 DEBUG sestatus: Max kernel policy version:      33

A number of other commands run regularly as part of metadata gathering (e.g. ceph-volume inventory, list-networks, ls) similarly print massive blocks of text into the log, making it hard to read through and making the overall size of the log file quickly become massive.

The default logging should be a little more picky about what it logs so the log is at least usable. We only need to log about our repeated metadata gathering if something interesting happens or an error occurs.

Comment 10 errata-xmlrpc 2023-06-15 09:16:51 UTC
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 (Moderate: Red Hat Ceph Storage 6.1 security and bug fix update), 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-2023:3623