Univention Bugzilla – Bug 55983
ucsschool-id-connector should log to STDERR, let host do logrotation
Last modified: 2023-11-30 11:38:48 CET
Currently, the ID Connector from time to time stops logging or the output is sent to a non-existent file. The loss of log entries is a critical problem in certain scenarios. Change the ID Connector to send its log output to STDERR. Then configure the host system to retrieve the logs from Docker and send it to a file (via rsyslog?). Configure the host systems logrotate.
The problem seems to also apply to the Kelvin REST API.
The file handler does not seem to be closed correctly. The last rotated file and the current log file get corrupted: -rw-rw-rw- 1 root root 11376 Mai 16 15:11 /var/log/univention/ucsschool-id-connector/queues.log -rw-rw-rw- 1 root root 46656 Mai 16 15:11 /var/log/univention/ucsschool-id-connector/queues.log.2023-05-16_14 after a few minutes: -rw-rw-rw- 1 root root 18960 Mai 16 15:17 /var/log/univention/ucsschool-id-connector/queues.log -rw-rw-rw- 1 root root 77760 Mai 16 15:17 /var/log/univention/ucsschool-id-connector/queues.log.2023-05-16_14 after a few minutes: -rw-rw-rw- 1 root root 22752 Mai 16 15:20 /var/log/univention/ucsschool-id-connector/queues.log -rw-rw-rw- 1 root root 93312 Mai 16 15:20 /var/log/univention/ucsschool-id-connector/queues.log.2023-05-16_14
The above was created by patching the code to rotate every hour.
As Logs get lost I have changed the assessment to a bug instead of a feature (while the latter is true from a implementation point of view it's not from the users perspective).
Fix was released with ucsschool-id-connector version 2.3.0.