View Issue Details

IDProjectCategoryView StatusLast Update
0008528New Feature Requests[All Projects] Generalpublic2017-06-18 20:57
ReporterStuartUKAssigned To 
Status newResolutionreopened 
Summary0008528: [Request] Ability to have multiple server logs rather then just one

The ability to have daily / monthly server logs would be nice, maybe by editing the logfile in the mtaconfig and having somethign like "logs/%d-%m-%y-server.log" where %d would be replayed with the day %m which month and %y with year etc

TagsNo tags attached.



2014-09-10 14:41

manager   ~~0021987

I have to second this. Even with only JOIN/QUIT/LOGIN being logged the log file can get to 500 MB after a few weeks. If a server actually logs stuff like chat to that log file, it'd be 50x worse.


2014-09-10 14:50

administrator   ~~0021988

Last edited: 2014-09-10 15:02

View 4 revisions

What's wrong about using a cronjob?

crontab -e
0 0 1 mv /path/to/logs/server.log "/path/to/backup/$(date +\%d-\%m-\%Y)-server.log"

That's a widely used standard solution with far more options, you may even zip and ftp the files to another machine, if desired. MTA will not be able to offer those options, nor there's any need to.

Edit: You can do the same on windows machines via 'at' command or windows task scheduler


2014-09-10 15:08

administrator   ~~0021989

<Stuart> I would comment on it ^ but i cant, You can't rename the file when the server is running so you have to restart the server just rename the log file
<Stuart> at least on windows

Now that's a problem, MTA shouldn't keep the file open.


2014-09-10 17:02

viewer   ~~0021991

0 0 1 cp /path/to/logs/server.log "/path/to/backup/$(date +\%d-\%m-\%Y)-server.log" && "" > /path/to/logs/server.log

^ This will copy the log file and clean up the current one. No server restart needed for that.


2014-09-17 14:30

viewer   ~~0022022

Why bloat the server if this can be easily achieved in lua?


2014-09-17 17:36

manager   ~~0022023

The only thing that's bloated is server.log and it can't be "easily achieved in lua" because server.log is unreachable with scripts.

Issue History

Date Modified Username Field Change