Log rotation on Linux?

My channels-dvr.log is 603 MB in size and goes back to 2023. Where can I configure log rotation?

Please submit diagnostics so we can check it out.

Sure thing! e044e2ff-ae0f-47a6-9948-d342d51e7485 is the ID I got.

I take it from your response that log rotation should automatically be configured?

Channels does not actually handle that. If the file size bothers you, you can handle it yourself.

Here is some pseudo-code you can add to a script to put in a cronjob:

  • stop channels
  • gzip channels-dvr.log -> channels-dvr-$(date).gz
  • rm channels-dvr.log
  • start channels

It appears we had some code in place to rotate the log file, but it isn't activated. I'm looking into what we can do to start doing this and still handle existing startup scripts.

4 Likes

Great, thanks very much! Happy to test anything / provide more info if needed.

I've pushed new docker images that enable log rotation. It will be more difficult to roll this out for existing install.sh-based installations and we'll have to figure out the right approach for that.

1 Like

Awesome, thanks. I am using an install.sh install locally so will wait to see what comes of it. I appreciate your work on this!

Thanks.
How often does it rotate the log, or is there a way to specify?

It rotates every 50mb with a maximum of 10 files.

2 Likes

Perfect. So once you have 10 files, the next rotation deletes the oldest one?

That's correct.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.