Docker-DocumentServer icon indicating copy to clipboard operation
Docker-DocumentServer copied to clipboard

Logs aren't output to stdout after log rotation

Open capybara614 opened this issue 1 year ago • 3 comments

Do you want to request a feature or report a bug?

This is a bug report.

What is the current behavior?

Logs are not outputted to stdout after logs are rotated. Logs are currently outputted to stdout using tail -f in the entrypoint. So when the file descriptor changes because of log rotation, tail isn't following the right files and doesn't output anything.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

  • Start a onlyoffice container
  • Open a shell
  • Force log rotation (with /usr/sbin/logrotate --force /etc/logrotate.conf)
  • Logs are not shown anymore but still written in their respective files

What is the expected behavior?

Logs should be outputted to stdout even after log rotation.

I see two way of fixing this :

  • Switch to tail -F in the entrypoint to follow filenames rather than file descriptors
  • Change the logrotate configuration file /etc/onlyoffice/documentserver/logrotate/ds.conf, so that the file descriptor doesn't change. Doing it that way would allow to stop restarting nginx and supervisor on log rotation which sounds like a bonus to me. This is what I came up with but I am by no means a log rotate expert.
/var/log/onlyoffice/documentserver/nginx.error.log {
        daily
        missingok
        rotate 30
        compress
        dateext
        copytruncate
        delaycompress
        notifempty
}

/var/log/onlyoffice/documentserver/**/*.log
/var/log/onlyoffice/documentserver-example/*.log {
        daily
        missingok
        rotate 30
        compress
        dateext
        delaycompress
        notifempty
        copytruncate
}

Did this work in previous versions of DocumentServer?

Yes. This commit installs the cron package which made logrotate work as intended but broke logging to stdout as a result.

DocumentServer Docker tag:

v8.0.1.1

Host Operating System:

Linux - 6.5.0-35-generic #35~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 7 09:00:52 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

capybara614 avatar May 22 '24 09:05 capybara614

Hello @capybara614, thank you for the detailed report, i can confirm - this is bug, issue #67888.

igwyd avatar May 22 '24 09:05 igwyd

After looking at the repository of the package, seems like this is already fixed in the upcoming version. Should I close this or wait until v8.1.0 is released ?

capybara614 avatar May 22 '24 10:05 capybara614

Yes, it's fixed. I would ask you not to close this issue, we will check it ourselves after relese. And of course you can check.

igwyd avatar May 23 '24 05:05 igwyd

Version 8.1 is released so I close this issue. Feel free to comment or reopen it if you got further questions.

Rita-Bubnova avatar Sep 04 '24 09:09 Rita-Bubnova