Automatic deletion of old logs

Hi,

OMERO produces a lot of logs. It looks like the logs follow the convention of logrotate, i.e:

Blitz-0.log
Blitz-0.log.1
Blitz-0.log.2

Logrotate has an option called maxage that remove logs older than N days.

Is there a similar option available to delete old logs in the OMERO server? This would be very useful as logs filling up the OS disk can cause our OMERO server to fall over.

Thanks,
Tjelvar

Hi @tjelvar-olsson. Welcome to image.sc!

The Blitz-0 logging is managed by logback. You can read more about it in our docs. It’s configured with the etc/logback.xml file (on github) and uses a max size rather than max age strategy. The relevant section is:

      <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
      <fileNamePattern>${omero.logfile}.%i</fileNamePattern>
      <minIndex>1</minIndex>
      <maxIndex>9</maxIndex>
    </rollingPolicy>
    <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
      <maxFileSize>500MB</maxFileSize>
    </triggeringPolicy>

i.e. create up to 9 files each of which is 500MB. Lowering either the number of files or their individual size is as easy as editing that file. No restart is necessary. Logback has a number of options though. Let us know which one ends up working the best for you.

~Josh