kernelci / kernelci-pipeline

Modular pipeline based on the KernelCI API
GNU Lesser General Public License v2.1
6 stars 18 forks source link

Enable log file support #672

Open JenySadadia opened 5 days ago

JenySadadia commented 5 days ago

Closes https://github.com/kernelci/kernelci-project/issues/334

Enable multiple log streams for Logger.

Create a file handler to dump logs to files. Use stream and file handlers for all the pipeline services to redirect logs to both the streams including stdout and log file. Update the logger config file.

JenySadadia commented 5 days ago

Staging seems working and creating log files for pipeline services:

kernelci@kernelci-staging:~/kernelci-deploy/checkout/kernelci-pipeline$ ls -lrt logs
total 68
-rw-r--r-- 1 kernelci kernelci  159 Jul  3 13:04 monitor_2024_07_03-13:03:55.log
-rw-r--r-- 1 kernelci kernelci  104 Jul  3 13:08 result_summary_2024_07_03-13:08:05.log
-rw-r--r-- 1 kernelci kernelci  164 Jul  3 13:10 test_report_2024_07_03-13:08:10.log
-rw-r--r-- 1 kernelci kernelci  159 Jul  3 13:10 monitor_2024_07_03-13:08:08.log
-rw-r--r-- 1 kernelci kernelci  642 Jul  3 13:10 timeout-closing_2024_07_03-13:08:10.log
-rw-r--r-- 1 kernelci kernelci  159 Jul  3 13:10 regression_tracker_2024_07_03-13:08:09.log
-rw-r--r-- 1 kernelci kernelci  175 Jul  3 13:10 timeout-holdoff_2024_07_03-13:08:10.log
-rw-r--r-- 1 kernelci kernelci  174 Jul  3 13:10 scheduler_2024_07_03-13:08:05.log
-rw-r--r-- 1 root     root      318 Jul  3 13:10 scheduler_2024_07_03-13:08:08.log
-rw-r--r-- 1 kernelci kernelci 8926 Jul  3 13:10 trigger_2024_07_03-13:08:10.log
-rw-r--r-- 1 kernelci kernelci 9832 Jul  3 13:10 timeout_2024_07_03-13:08:06.log
-rw-r--r-- 1 kernelci kernelci 1962 Jul  3 13:10 scheduler_2024_07_03-13:08:10.log
-rw-r--r-- 1 kernelci kernelci 1410 Jul  3 13:10 tarball_2024_07_03-13:08:10.log

@nuclearcat Let me know if the file naming convention needs to be tweaked.

JenySadadia commented 5 days ago

@nuclearcat We also need to add some kind of purge service that will discard the log files older than some decided number of days. Otherwise, It will create storage issues on VM.