[Satellite6] How to enable selective debug logging in foreman/katello
Environment
- Red Hat Satellite 6.2 or higher
Issue
- how to enable selective logging/debugging just for some areas of katello/foreman?
Resolution
Notice: This solution describes modification of selective debugging within katello and/or foreman only. For more generic solution how to change logging verbosity of Satellite components, please follow this solution. Further to that, it is possible to print queries that katello performs against pulp and/or candlepin - see this solution for more.
To enable selective logging within foreman/katello, change the settings first and then apply the change.
Applicable to Satellite 6.11+
To change settings, edit /etc/foreman/settings.yaml on one place:
# Individual logging types can be toggled on/off here
:loggers:
:sql:
:level: debug
:enabled: true
Set :level: debug and enabled: true every time for every specific logger you are interested in.
Complete list of loggers with their default values can be found in /usr/share/foreman/config/application.rb in Foreman::Logging.add_loggers command. Like for Satellite 6.11:
# Check that the loggers setting exist to configure the app and sql loggers
Foreman::Logging.add_loggers((SETTINGS[:loggers] || {}).reverse_merge(
:app => {:enabled => true},
:audit => {:enabled => true},
:ldap => {:enabled => false},
:permissions => {:enabled => false},
:proxy => {:enabled => false},
:sql => {:enabled => false},
:templates => {:enabled => true},
:notifications => {:enabled => true},
:background => {:enabled => true},
:dynflow => {:enabled => true},
:telemetry => {:enabled => false},
:blob => {:enabled => false},
:taxonomy => {:enabled => true},
:api_deprecations => {:enabled => true},
:sidekiq => {:enabled => true, :level => :warn}
))
To apply the change, restart relevant Satellite services:
systemctl restart dynflow-sidekiq@*.service foreman.service
For older (unsupported) Satellite versions (6.10-):
To change settings, edit /etc/foreman/settings.yaml on two places. First, set appropriate level of logging (info, debug,..):
:logging:
:production:
:type: file
:layout: multiline_request_pattern
:level: debug ## add this line
Second, to selectively enable some loggers, add to the end:
:loggers:
:ldap:
:enabled: true
:permissions:
:enabled: true
:sql:
:enabled: true
It is possible to enable just some of the loggers. Note that to see logging from some area, debug logging has to be set.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.