Gitea: Rework log rotation

Created on 6 Nov 2018  路  2Comments  路  Source: go-gitea/gitea

Currently, log rotation in gitea is done implicitly in the file logger when log files exceeds a given age or size. This can cause race condition on "serv" commands where multiple processes write to the same logfile.
Example:
2 serv commands are started, read the logfile size which is close to maximum size and write a log line. Now both processes will rotate the logs.

We should either
a) rework log rotation so that is handled by the long-running server process
b) remove log rotation entirely from gitea and use "logrotate" on the docker images.
or
c) remove file logging entirely from gitea and use the sysem's logging infrastructure (syslog, systemd-journal or such)

kinproposal

Most helpful comment

I think we could use another matured log library to maintain a this one.

All 2 comments

I think we could use another matured log library to maintain a this one.

I'm going to close this as we no longer write to the serv.log.

Was this page helpful?
0 / 5 - 0 ratings