Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Future Improvements (https://forums.graalonline.com/forums/forumdisplay.php?f=10)
-   -   Automatic Log Rotation (https://forums.graalonline.com/forums/showthread.php?t=134266481)

cbk1994 05-20-2012 01:32 PM

Automatic Log Rotation
 
It would be nice if we could configure logs to be automatically rotated. Even some kind of simplified logrotate options in server options would make the lives of administrators on large servers a lot easier and probably save you a lot of disk space as well (just deleted a 250 MB log file on Era).

Example of server options:

PHP Code:

logrotate=itemlog.txt,trading.txt
logrotate
-itemlog.txt=30,daily,compress # keep 30 old logfiles, rotate daily, gzip old files
logrotate-trading.txt=15,10mb # keep 15 old logfiles, rotate when reaches 10 MB 

Syntax doesn't really matter, but it'd be really nice to not have to download huge files just to check a single line.

http://uploads.graalcenter.org/uploa...31.10%20AM.png

This should be a fairly simple addition which would be great for server staff and save Eurocenter quite a bit of storage space (the same file gzipped is about 13 MB).

Emera 05-24-2012 08:55 PM

Wouldn't you be able to load a log file and check how many lines it has, and if it's got more than so many lines, create a new file? That's what I would do.

Crow 05-24-2012 09:38 PM

Quote:

Originally Posted by Emera (Post 1695495)
Wouldn't you be able to load a log file and check how many lines it has, and if it's got more than so many lines, create a new file? That's what I would do.

I don't think you can rename logs via script.

Stephen 05-24-2012 09:39 PM

wouldn't SQL logs solve this?

Emera 05-24-2012 10:23 PM

Quote:

Originally Posted by Crow (Post 1695498)
I don't think you can rename logs via script.

PHP Code:

if (temp.linecount >= MAXLINES) {
  
temp.logsave++;
}
savelog2("whatever_"@temp.logsave@".txt"temp.logsave); 

Wouldn't that be a solution?

DustyPorViva 05-24-2012 10:42 PM

Quote:

Originally Posted by Emera (Post 1695507)
PHP Code:

if (temp.linecount >= MAXLINES) {
  
temp.logsave++;
}
savelog2("whatever_"@temp.logsave@".txt"temp.logsave); 

Wouldn't that be a solution?

You can't edit the actual logs though, so they'd build up regardless.

cbk1994 05-24-2012 10:47 PM

Quote:

Originally Posted by Stephen (Post 1695499)
wouldn't SQL logs solve this?

Yes, but they come with additional problems. Logging is not a major problem on Era so I am not really that interested in redoing the entire system, even though it would benefit.

Quote:

Originally Posted by Emera (Post 1695507)
PHP Code:

if (temp.linecount >= MAXLINES) {
  
temp.logsave++;
}
savelog2("whatever_"@temp.logsave@".txt"temp.logsave); 

Wouldn't that be a solution?

Yes, but I'd like it to gzip and eventually delete old logs as well so that staff don't have to do this.

Emera 05-24-2012 10:48 PM

Quote:

Originally Posted by DustyPorViva (Post 1695510)
You can't edit the actual logs though, so they'd build up regardless.

Oh I see. Sucks :(

Emera 05-24-2012 10:49 PM

Quote:

Originally Posted by cbk1994 (Post 1695512)
Yes, but I'd like it to gzip and eventually delete old logs as well so that staff don't have to do this.

Ah :/


All times are GMT +2. The time now is 02:05 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.