-
Task
-
Resolution: Done
-
Undefined
-
Conversions-Phase 3
-
None
Goal:
Currently, the convert2rhel-worker-script is using print() to log important information to the stdout. While this works, it is not the best solution we could use. Instead, we want to switch to use the logger module from python to enable us to also save those logs to a file.
This will also enable us to separate our logs between information we want to share with the user, and debug information relevant to development.
Acceptance Criteria:
- Replace the print() calls with their appropriate logger calls
- Output the logs to a file as well as to the stdout
- Make a mechanism to archive the old log files, similar to https://github.com/oamg/convert2rhel/blob/main/convert2rhel/logger.py#L197
- Make sure the log file is also collected to sosreport
Notes:
- sosreport is not accepting plugins for RHEL7 anymore, instead, we have to create a file in the /etc/sos.extras.d folder to indicate where sosreport can collect our log file.
- Example on how it is done in the rhc-worker-script logs: https://github.com/oamg/rhc-worker-script/blob/main/src/logger.go#L64-L82