Univention Bugzilla – Bug 48893
UNIVENTION_DEBUG_BEGIN and UNIVENTION_DEBUG_END spam in various logfiles at low loglevels
Last modified: 2020-04-30 11:08:45 CEST
The listener.log, directory-manager-cmd.log and probably other logfiles get spammed with completely useless log messages even when their loglevel is the default: UNIVENTION_DEBUG_END : uldap.parentDn dn=cn=udm_module,cn=univention,dc=uni,dc=dtr base=dc=uni,dc=dtr UNIVENTION_DEBUG_BEGIN : uldap.parentDn dn=cn=appcenter/app,cn=udm_module,cn=univention,dc=uni,dc=dtr base=dc=uni,dc=dtr UNIVENTION_DEBUG_END : uldap.parentDn dn=cn=appcenter/app,cn=udm_module,cn=univention,dc=uni,dc=dtr base=dc=uni,dc=dtr UNIVENTION_DEBUG_BEGIN : uldap.parentDn dn=cn=udm_module,cn=univention,dc=uni,dc=dtr base=dc=uni,dc=dtr UNIVENTION_DEBUG_END : uldap.parentDn dn=cn=udm_module,cn=univention,dc=uni,dc=dtr base=dc=uni,dc=dtr UNIVENTION_DEBUG_BEGIN : admin.handlers.base.__getitem__ key = data UNIVENTION_DEBUG_END : admin.handlers.base.__getitem__ key = data directory/manager/cmd/debug/level: 0 listener/debug/level: 2 listener/module/<name>/debug/level: <empty> Those look like function trace messages. They should be logged at much higher loglevels only.
See Bug #43422 for a proposed change to add a function decorator to replace that broken functionality of univention.debug Let's schedule that for BSD @ 2019-04-11 ?
The problem with "function" is, that it is controlled by "set_function()", which is orthogonal to "set_level()". While the later can be configured individually by UCR variables, the former (currently) is not. This is further complicated by the fact, that "function" has no association to any "category", so it's level is not controlled by "set_level(category,level)". This is a limitation of the C level interface, which cannot be fixed easily as this required an API change.
Created attachment 10260 [details] example patch Why is it an API change to make it configurable like in the example patch?
(In reply to Florian Best from comment #3) > Created attachment 10260 [details] > example patch > > Why is it an API change to make it configurable like in the example patch? Your patch is specific to UDL and you hard-disable all function logging (from that process). Re-enabling it via UCR is no longer easy for support. But this bug is against generic u-debug, which is used in many other cases and you need to change (respective write new code for) each program to make it configurable.
(In reply to Philipp Hahn from comment #4) > Your patch is specific to UDL and you hard-disable all function logging > (from that process). Re-enabling it via UCR is no longer easy for support. It's an example, I just didn't know the bash syntax for `ucr.is_true('listener/debug/function', True) ? "-n" : ""` which can be passed to the UDL. Should I clone this bug against the listener to make it configurable via UCR?
I don't think we need something generic for UCR. UDM-CLI itself doesn't do function logging: modules/univention/admincli/admin.py: ud.init(logfile, 1, 0) univention-cli-server: ud.init(logfile, ud.FLUSH, ud.NO_FUNCTION) univention-cli-server: ud.init(logfile, ud.FLUSH, ud.NO_FUNCTION) Only more rarely used UDM scripts do: modules/univention/admincli/adduser.py: ud.init('/var/log/univention/directory-manager-cmd.log', 1, 1) modules/univention/admincli/passwd.py: ud.init('/var/log/univention/directory-manager-cmd.log', 1, 1) univention-dnsedit:ud.init('/var/log/univention/directory-manager-cmd.log', ud.FLUSH, ud.FUNCTION)