make loglevel usage sane

Bug #1800851 reported by Martin Steigerwald
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Expired
Undecided
Unassigned

Bug Description

Seen with cloud-init-18.2-3.13.x86_64 from SLES 15 Public-Cloud-Module_15-0.

This is debug:

2018-10-31 13:57:37,557 - util.py[DEBUG]: Reading from /etc/cloud/cloud.cfg (quiet=False)
2018-10-31 13:57:37,557 - util.py[DEBUG]: Read 2178 bytes from /etc/cloud/cloud.cfg
2018-10-31 13:57:37,557 - util.py[DEBUG]: Attempting to load yaml from string of length 2178 with allowed root types (<class 'dict'>,)
2018-10-31 13:57:37,564 - util.py[DEBUG]: Reading from /etc/cloud/cloud.cfg.d/05_logging.cfg (quiet=False)
2018-10-31 13:57:37,565 - util.py[DEBUG]: Read 2057 bytes from /etc/cloud/cloud.cfg.d/05_logging.cfg
2018-10-31 13:57:37,565 - util.py[DEBUG]: Attempting to load yaml from string of length 2057 with allowed root types (<class 'dict'>,)
2018-10-31 13:57:37,570 - util.py[DEBUG]: Reading from /run/cloud-init/cloud.cfg (quiet=False)
2018-10-31 13:57:37,570 - util.py[DEBUG]: Read 35 bytes from /run/cloud-init/cloud.cfg
2018-10-31 13:57:37,570 - util.py[DEBUG]: Attempting to load yaml from string of length 35 with allowed root types (<class 'dict'>,)
2018-10-31 13:57:37,571 - util.py[DEBUG]: Attempting to load yaml from string of length 0 with allowed root types (<class 'dict'>,)
2018-10-31 13:57:37,571 - util.py[DEBUG]: loaded blob returned None, returning default.
2018-10-31 13:57:37,571 - util.py[DEBUG]: Reading from /var/lib/cloud/instance/cloud-config.txt (quiet=False)
2018-10-31 13:57:37,572 - util.py[DEBUG]: Read 1682 bytes from /var/lib/cloud/instance/cloud-config.txt
2018-10-31 13:57:37,572 - util.py[DEBUG]: Attempting to load yaml from string of length 1682 with allowed root types (<class 'dict'>,)
2018-10-31 13:57:37,577 - util.py[DEBUG]: Reading from /var/lib/cloud/instance/cloud-config.txt (quiet=False)
2018-10-31 13:57:37,577 - util.py[DEBUG]: Read 1682 bytes from /var/lib/cloud/instance/cloud-config.txt
2018-10-31 13:57:37,577 - util.py[DEBUG]: Attempting to load yaml from string of length 1682 with allowed root types (<class 'dict'>,)
2018-10-31 13:57:37,584 - util.py[DEBUG]: Writing to /var/lib/cloud/instance/obj.pkl - wb: [400] 7308 bytes
2018-10-31 13:57:37,586 - main.py[DEBUG]: no di_report found in config.

This is important:

2018-10-31 13:57:37,530 - stages.py[DEBUG]: not a new instance. network config is not applied.

Both are marked a debug. So currently I default to use "grep -v util.py" when looking at cloud init logs to retain my own sanity. I think it is possible to make it easier than this for admins to use cloud-init. Especially as when compared to 0.7.9 cloud-init has seem to become way more complex and more difficult to understand.

Revision history for this message
Chad Smith (chad.smith) wrote :

Thank you for filing this bug and making cloud-init better. In this specific logged case, that log message was only indicating that no config-related action was taken on the machine, so it does feel properly leveled at DEBUG because this is intended behavior in cloud-init across reboots when no instance data changes to indicate cloud-init should re-run various configuration modules. It feels a bit like reverse grep ruling out log messages based on a specific module util.py will only mask potential errors or warnings that are emitted from that module and still leave noisy debug messages from all other modules.

May I suggest instead to look only at info, warning and error level messages?

cloud-init tries to use INFO WARNING and ERROR log level to indicate something the user should pay attention to, so a more appropriate grep would be egrep 'INFO|WARNING|ERROR' /var/log/cloud-init.log.

For example, if cloud-init is performing a network configuration change we'd see the following INFO level message
2019-01-18 21:25:25,933 - stages.py[INFO]: Applying network configuration from ds bringup=False: {'version': 1, 'config': [{'subnets': [{'type': 'dhcp', 'control': 'auto'}], 'type': 'physical', 'name': 'eth0'}]}

Alternatively: cloud-init status --long on newer cloud-init v 18.x will report specific errors from the cli so you don't have to dive into the noisy log in the first place.

Changed in cloud-init:
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for cloud-init because there has been no activity for 60 days.]

Changed in cloud-init:
status: Incomplete → Expired
Revision history for this message
James Falcon (falcojr) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.