[GH-ISSUE #736] Logs aren't output to stdout after log rotation #333

Closed
opened 2026-02-26 10:31:54 +03:00 by kerem · 4 comments
Owner

Originally created by @capybara614 on GitHub (May 22, 2024).
Original GitHub issue: https://github.com/ONLYOFFICE/Docker-DocumentServer/issues/736

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

Originally created by @capybara614 on GitHub (May 22, 2024). Original GitHub issue: https://github.com/ONLYOFFICE/Docker-DocumentServer/issues/736 **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](https://github.com/ONLYOFFICE/Docker-DocumentServer/blob/master/run-document-server.sh#L656). 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](https://github.com/ONLYOFFICE/Docker-DocumentServer/commit/0a42ee66b0c25c40375f471998d0470b68504d29) 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
kerem 2026-02-26 10:31:54 +03:00
Author
Owner

@igwyd commented on GitHub (May 22, 2024):

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

<!-- gh-comment-id:2124309149 --> @igwyd commented on GitHub (May 22, 2024): Hello @capybara614, thank you for the detailed report, i can confirm - this is bug, issue #67888.
Author
Owner

@capybara614 commented on GitHub (May 22, 2024):

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 ?

<!-- gh-comment-id:2124493990 --> @capybara614 commented on GitHub (May 22, 2024): After looking at the repository of the package, seems like this is already [fixed](https://github.com/ONLYOFFICE/document-server-package/commit/a9964d64c2ac0c201715059b4e10ebfac171e184) in the upcoming version. Should I close this or wait until v8.1.0 is released ?
Author
Owner

@igwyd commented on GitHub (May 23, 2024):

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.

<!-- gh-comment-id:2126258852 --> @igwyd commented on GitHub (May 23, 2024): 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.
Author
Owner

@Rita-Bubnova commented on GitHub (Sep 4, 2024):

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

<!-- gh-comment-id:2328312759 --> @Rita-Bubnova commented on GitHub (Sep 4, 2024): Version 8.1 is released so I close this issue. Feel free to comment or reopen it if you got further questions.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Docker-DocumentServer-ONLYOFFICE#333
No description provided.