User access logs retained longer?

Tom Davies 5 years ago updated by Bob ArdKor 10 months ago 4

Is there a way to set the amount of time the logs are retained? What is the current retention time, or is it just a number of files that are kept, like the last five?

The reason I ask is I would like to monitor the users that access my server and what they are viewing/downloading. Looking at my logs right now, I've only got about 24 hours worth, which isn't what I was expecting.

Ideally I'd like to retain weeks of the logs, then run a perl script against them to extract the user logins, failed attempts, file downloads and files read online. If you made that a separate log, that would be even better!

Also, while I think of it, I didn't see in the logs where a file was accessed/read online, just the downloads. Could that be logged too?


The log file grows up to 1MB, then it is zipped and a new log file is created.

5 zip files are kept, when a 6th one is created, the oldest one is replaced.

This behavior can be overridden by your own configuration.

This tutorial explains how to use an external configuration file.

The settings you'll want to modify are "maxIndex" (max number of kept zip files) in the "rollingPolicy" section and "maxFileSize" (max size of a log files before it is zipped) in the "triggeringPolicy" section.

The full documentation of the logger configuration is available here, but it's not very user friendly. Ask me if you need more info.

As for the logging of read comics, I'll add it.

Thanks! I'll dig into those docs and see what I can do with them.

Sorry for reopening a very old request but, to quote OP :

"I didn't see in the logs where a file was accessed/read online, just the downloads."

I'm seeing the exact opposite. There is no mention of downloads in the logs, only online reading. I'm guessing this changed since then. Is there a way to monitor downloads ?