ipa-dnskeysyncd: Raise loglevel to DEBUG

Previously, the logging level of StreamHandler for ipa-dnskeysyncd
was restricted to INFO via `standard_logging_setup(verbose=False)`.
Thus, it was impossible to get messages having lower level.

This also sets the loglevel for ipa-dnskeysyncd to DEBUG for
troubleshooting.

Fixes: https://pagure.io/freeipa/issue/8094
Signed-off-by: Stanislav Levin <slev@altlinux.org>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Christian Heimes <cheimes@redhat.com>
This commit is contained in:
Stanislav Levin 2020-08-14 13:49:41 +03:00 committed by Alexander Bokovoy
parent e2030b8cad
commit 92157bc880
3 changed files with 4 additions and 19 deletions

View File

@ -145,7 +145,7 @@ def ldap2replica_zone_keys_sync(ldapkeydb, localhsm):
# IPA framework initialization # IPA framework initialization
standard_logging_setup(verbose=True, debug=True) standard_logging_setup(debug=True)
ipalib.api.bootstrap(context='dns', confdir=paths.ETC_IPA, in_server=True) ipalib.api.bootstrap(context='dns', confdir=paths.ETC_IPA, in_server=True)
ipalib.api.finalize() ipalib.api.finalize()

View File

@ -23,12 +23,9 @@ logger = logging.getLogger(os.path.basename(__file__))
# IPA framework initialization # IPA framework initialization
standard_logging_setup(verbose=True) standard_logging_setup(debug=True)
api.bootstrap(context='dns', confdir=paths.ETC_IPA, in_server=True) api.bootstrap(context='dns', confdir=paths.ETC_IPA, in_server=True)
api.finalize() api.finalize()
if api.env.debug:
root_logger = logging.getLogger()
root_logger.setLevel(logging.DEBUG)
# Global state # Global state
watcher_running = True watcher_running = True

View File

@ -29,12 +29,12 @@ import dns.dnssec
from gssapi.exceptions import GSSError from gssapi.exceptions import GSSError
import six import six
import systemd.daemon import systemd.daemon
import systemd.journal
import ipalib import ipalib
from ipalib.constants import SOFTHSM_DNSSEC_TOKEN_LABEL from ipalib.constants import SOFTHSM_DNSSEC_TOKEN_LABEL
from ipalib.install.kinit import kinit_keytab from ipalib.install.kinit import kinit_keytab
from ipapython.dn import DN from ipapython.dn import DN
from ipapython.ipa_log_manager import standard_logging_setup
from ipapython import ipaldap from ipapython import ipaldap
from ipaplatform.paths import paths from ipaplatform.paths import paths
from ipaserver.dnssec.abshsm import sync_pkcs11_metadata, wrappingmech_name2id from ipaserver.dnssec.abshsm import sync_pkcs11_metadata, wrappingmech_name2id
@ -650,20 +650,8 @@ def cleanup_ldap_zone(ldap, dns_dn, zone_name):
ldap.delete_entry(ldap_key) ldap.delete_entry(ldap_key)
# this service is usually socket-activated
root_logger = logging.getLogger()
root_logger.addHandler(systemd.journal.JournalHandler())
root_logger.setLevel(level=logging.DEBUG)
if len(sys.argv) > 2:
print(__doc__)
sys.exit(1)
# program was likely invoked from console, log to it
elif len(sys.argv) == 2:
console = logging.StreamHandler()
root_logger.addHandler(console)
# IPA framework initialization # IPA framework initialization
standard_logging_setup(debug=True)
ipalib.api.bootstrap(context='dns', confdir=paths.ETC_IPA, in_server=True) ipalib.api.bootstrap(context='dns', confdir=paths.ETC_IPA, in_server=True)
ipalib.api.finalize() ipalib.api.finalize()