Bug 48893 - UNIVENTION_DEBUG_BEGIN and UNIVENTION_DEBUG_END spam in various logfiles at low loglevels
UNIVENTION_DEBUG_BEGIN and UNIVENTION_DEBUG_END spam in various logfiles at l...
Status: NEW
Product: UCS
Classification: Unclassified
Component: univention-debug
UCS 4.4
Other Linux
: P5 normal with 4 votes (vote)
: ---
Assigned To: UCS maintainers
UCS maintainers
:
Depends on:
Blocks: 51193
  Show dependency treegraph
 
Reported: 2019-03-07 09:18 CET by Daniel Tröder
Modified: 2020-04-30 11:08 CEST (History)
2 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 3: Simply Wrong: The implementation doesn't match the docu
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.069
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): API change
Max CVSS v3 score:


Attachments
example patch (2.36 KB, patch)
2019-12-11 09:09 CET, Florian Best
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Tröder univentionstaff 2019-03-07 09:18:03 CET
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.
Comment 1 Philipp Hahn univentionstaff 2019-03-18 09:49:40 CET
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 ?
Comment 2 Philipp Hahn univentionstaff 2019-05-20 13:42:28 CEST
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.
Comment 3 Florian Best univentionstaff 2019-12-11 09:09:37 CET
Created attachment 10260 [details]
example patch

Why is it an API change to make it configurable like in the example patch?
Comment 4 Philipp Hahn univentionstaff 2019-12-11 09:31:43 CET
(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.
Comment 5 Florian Best univentionstaff 2019-12-11 09:39:24 CET
(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?
Comment 6 Florian Best univentionstaff 2019-12-11 09:42:15 CET
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)