Univention Bugzilla – Bug 47327
Use a standard JSON format for structured logging
Last modified: 2021-05-14 16:34:29 CEST
We use several free style formats for logging internally, for example univention-join outputs a single line prefixed with "* Message", but the joinscripts output messages with a "__JOINERR__:" prefix. It would be good to define and use a standard format for structured logging. I would suggest a JSON format because it lends itself to serialization to/from text format. Something like this: { "Message-Type": "Setup Error", "Source": $joinscript, "Headline": "Join failed", "Details": "Long\nStuff", "Returncode": 1, "Timestap": $timestamp} Maybe it would be useful to use (or allow) a modified form of JSON here, using single quotes, to make life simpler for sending this from Shell: echo "{'Message-Type': 'Setup Error', 'Source': '$0', 'Timestamp': '$(date)'}" This can easily be transformed into standard JSON in Python for post processing.
I would like to read log messages that i can parse easily, if i have to access logfiles. The proposed format is not easily readable in my opinion. Maybe we could adapt the logging to write additional log entries, into different logfiles, that are easily parseable by programs.
The __JOINERR__/etc. exists for filling the progressbar content. So yes, I would also like to have additional log files for the progress bars.
This issue has been filed against UCS 4.3. UCS 4.3 is out of maintenance and many UCS components have changed in later releases. Thus, this issue is now being closed. If this issue still occurs in newer UCS versions, please use "Clone this bug" or reopen it and update the UCS version. In this case please provide detailed information on how this issue is affecting you.