noobaa-core
noobaa-core copied to clipboard
bucket_logging: Bucket log processing in side car container
Firstly, rsyslogd and logrotate.sh script has been moved to side car container. Now, these two processes will be started by "command" rather than superviserd
Secondly, we have added following bash script and changes in logrotate_noobaa.conf 1 - Added an entry in conf file to rotate /var/log/bucket_logs.log
2 - Rotated files will be moved to /var/log/noobaa_logs/ and each rotated file will have dat and time attached to its name. Example: bucket_logs.log2024-02-19-10-09-16
3 - These files will have logs for all the buckets from all the endpoints.
4 - Added a bash script noobaa_log_segregate.sh, which will keep reading rotated files in /var/log/noobaa_logs/ and segregate the bucket logs in its respective log file names. These will be kept at /log/noobaa_bucket_logs/
For example: log.bucket-1-2024-02-19-10-05-58.341870679.log log.bucket-2-2024-02-19-09-49-37.242243366.log
5 - These are the final log objects which will be sent to respective bucket logs.
Testing Instructions:
./noobaa_logs_create.sh <log_bucket_range> This script can be used to test log parsing. It takes number of buckets, which you want to have logs from. Logs will be sent to /var/log/bucket_logs.log, which is actually the path where rsyslogd will save the logs. Log buckets will be having name like log.bucket-1, log.bucket-2, etc. So, to test if the BG worker is uploading the logs correctly, you need to create buckets with similar names. Example: ./noobaa_logs_create.sh 10
@dannyzaken You are right. I left supervisord conf file as it is just to make sure that this change works even when PR for operator (which create side car container) is not there. I will remove the rsyslog and logrotate from its conf file.
@dannyzaken You are right. I left supervisord conf file as it is just to make sure that this change works even when PR for operator (which create side car container) is not there. I will remove the rsyslog and logrotate from its conf file.
we might need to change the way we write our logs in the debug module