Bug 52311 - improve default behaviour of ucs-school-import
improve default behaviour of ucs-school-import
Status: NEW
Product: UCS@school
Classification: Unclassified
Component: General
UCS@school 4.4
Other Linux
: P5 normal (vote)
: ---
Assigned To: UCS@school maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2020-11-03 21:02 CET by Dirk Ahrnke
Modified: 2020-11-04 08:14 CET (History)
1 user (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 5: Major Usability: Impairs usability in key scenarios
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Large environments
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Ahrnke univentionstaff 2020-11-03 21:02:10 CET
/usr/share/ucs-school-import/configs/global_defaults.json defines a default for logging as

"logfile": "/var/log/univention/ucs-school-import.log",

With this configuration and without overriding it in further config-files this will effectively log all activities of ucs-school-import on DEBUG level. 
APIs relying on ucs-school-import will also cause log entries. 

It has been observed that the log may grow quickly with several GB per day.

As there is no logrotation implemented there is no pro-active countermeasure against filling the partition containing /var/log/univention. 

Although the documentation mentions that ucs-school-import.log will contain DEBUG it is doubtful that this notice will be taken into account for administration procedures. 

I see 3 options (increasing weight):
- improve the documentation 
- reduce default logging to INFO and implement a centralized log control for ucs-school-import.log
- implement configurable log rotation for ucs-school-import.log (should be the default for all components of delivered software)
Comment 1 Daniel Tröder univentionstaff 2020-11-04 08:14:47 CET
(In reply to Dirk Ahrnke from comment #0)
> /usr/share/ucs-school-import/configs/global_defaults.json defines a default
> for logging as
> 
> "logfile": "/var/log/univention/ucs-school-import.log",
> 
> With this configuration and without overriding it in further config-files
> this will effectively log all activities of ucs-school-import on DEBUG
> level.

I suggest to introduce new and separate configuration settings for
a) log level of command line output
b) log level of log file

The current configuration option "verbose" is only for a) and is a boolean (True: DEBUG, False: INFO).

> APIs relying on ucs-school-import will also cause log entries. 

That is an error in those APIs and cannot be fixed in the ucs-school-import code.

> It has been observed that the log may grow quickly with several GB per day.
> 
> As there is no logrotation implemented there is no pro-active countermeasure
> against filling the partition containing /var/log/univention. 

The log files of the ucs-school-import are already rotated on a daily basis (/var/log/univentio/ucs-school-import.log.%Y-%m-%d).
I haven't seen a requirement until now to rotate more often than that.
If desired, the logs can be compressed after rotation by a cronjob.

If the logfile is not rotated, then something else (APIs mentioned above?) than the ucs-school-import is writing to it, without rotating it. The ucs-school-import does rotate.

> Although the documentation mentions that ucs-school-import.log will contain
> DEBUG it is doubtful that this notice will be taken into account for
> administration procedures. 
> 
> I see 3 options (increasing weight):
> - improve the documentation

What are you missing and where?

> - reduce default logging to INFO and implement a centralized log control for
> ucs-school-import.log

* "reduce default logging to INFO": yes, and make configurable (see above)
* "implement a centralized log control for ucs-school-import.log": that is already there, it seems that it is not used.

> - implement configurable log rotation for ucs-school-import.log

Log rotation already exists, although it's not configurable. Is that really required? The current setting is to rotate daily and keep 10000000 backups. Maybe that should be reduced.

> (should be the default for all components of delivered software)

Absolutely. Where are you missing it?