 |
adamwalker Apprentice
Joined: 12 Mar 2005 Posts: 195
|
Posted: Tue Dec 12, 2006 1:38 pm
Not a bug. Use of #LOG and preiodic logging. |
I am a mud obsessive. I admit, and my logs can reach 6 meg per day.
Which means if i want to open them for review, i suffer huge slow down from thousands of lines of text.
Is there a way I could code it so that if the log reached 1meg (for example). It would create a new log with a new filename and start logging to that.
I did think about using an alarm that would fire hourly maybe to create a new log. |
|
|
|
 |
Fang Xianfu GURU

Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Tue Dec 12, 2006 1:43 pm |
I suffer the same problem. No joke, one of my log files is 30mb. The way I do it is to have a 6hr alarm (midnight, 6am, noon, 6pm) that sets the log with the name Mudname-YY-MM-DD-HH-MM.txt through the %time function. Cuts them down nicely.
|
|
|
|
 |
crycry Apprentice

Joined: 24 Jun 2006 Posts: 169 Location: UK - South Coast
|
Posted: Tue Dec 12, 2006 1:55 pm |
thats a brilliant idea Fang.
|
|
_________________ 'Life is what happens, when your too busy doing something else'
_________________
XP Pro SP2
cMud 1.24
_________________ |
|
|
 |
adamwalker Apprentice
Joined: 12 Mar 2005 Posts: 195
|
Posted: Tue Dec 12, 2006 1:56 pm |
im impressed, the biggest ive ever had was 22meg. yeah ill just do it like that i think.
|
|
|
|
 |
adamwalker Apprentice
Joined: 12 Mar 2005 Posts: 195
|
Posted: Tue Dec 12, 2006 1:57 pm |
is there a way to get cmud to create a folder? it would be nice to have a folder for each day. and the logs broken up inside the folder
|
|
|
|
 |
Fang Xianfu GURU

Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Tue Dec 12, 2006 2:35 pm |
That's the point of using yy-mm-dd rather than mm-dd-yy or dd-mm-yy, whichever's appropriate in your country. If you sort them alphabetically, they'll be in date order. Regardless, yes there is, you just use the path:
#log {logs\logname.txt}
I'm not sure if it requires backslashes or slashes. But theoretically you could do:
#log {logs\%time(yyyy-mm-dd)\Mudname-%time(hh-nn).txt} |
|
|
|
 |
adamwalker Apprentice
Joined: 12 Mar 2005 Posts: 195
|
Posted: Tue Dec 12, 2006 3:08 pm |
hmm tried that but it doesnt seem to actually create the directory.
|
|
|
|
 |
Fang Xianfu GURU

Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Tue Dec 12, 2006 3:19 pm |
Doesn't do it if you use slashes instead of backslashes either?
Make sure it's not just creating it somewhere you don't expect, too - I'm pretty sure the default path is the Mudname folder in CMUD's data dir. If you want to use something else you can specify the full path. |
|
|
|
 |
adamwalker Apprentice
Joined: 12 Mar 2005 Posts: 195
|
Posted: Tue Dec 12, 2006 3:27 pm |
tried
#log c:\logs\%time(yyyy-mm-dd)\mylog%time(hh-nn).txt
and
#log c:/logs/%time(yyyy-mm-dd)/mylog%time(hh-nn).txt
with no luck |
|
|
|
 |
Fang Xianfu GURU

Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Tue Dec 12, 2006 3:39 pm |
Well, that's a bugger. Does it work just with:
#log mylog%time(hh-nn).txt
Because it's possible that it doesn't like the function in the middle. Might have to use %concat or something |
|
|
|
 |
crycry Apprentice

Joined: 24 Jun 2006 Posts: 169 Location: UK - South Coast
|
Posted: Tue Dec 12, 2006 3:48 pm |
this is almost the same thing im doing on my thread Fang, i found i had to store %time in a variable first, then expand it inside the log call.
this works fine.
| Code: |
#var main_tag (%time( m.d.e) + "mainWindow")
#LOG logs\@{main_tag}.txt |
i cant get it to work with local vars though, which is what im working on right now. |
|
_________________ 'Life is what happens, when your too busy doing something else'
_________________
XP Pro SP2
cMud 1.24
_________________ |
|
|
 |
Fang Xianfu GURU

Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Tue Dec 12, 2006 3:55 pm |
Perhaps it's a quirk of the #LOG command in CMUD, because things like that worked just fine in zMUD. Bug, or intentional?
|
|
|
|
 |
Seb Wizard
Joined: 14 Aug 2004 Posts: 1269
|
Posted: Tue Dec 12, 2006 7:35 pm |
I used #LOG %concat( stuff, more stuff, etc) in zMUD, where some of the concat arguments are %char and %time( "yyyy-mm-dd"). I never tried it to create folders though.
As an aside, I doubt you really want folders called %time(yyyy-mm-dd)... You could end up with a lot of folders if you do a lot of logging and slow your computer down. Probably better to have them divided by month. |
|
|
|
 |
Fang Xianfu GURU

Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Tue Dec 12, 2006 9:07 pm |
Well, he specifically asked for a folder for each day. Personally, I'm happy with a big list if text files that I can just sort alphabetically.
Something interesting, though. The default folder for log file creation is the CMUD installation directory - this doesn't seem right now that data and files have been separated (and could cause problems if the user doesn't have write access to the CMUD drive). I'd expect them to be created in the Data directory at the least, preferably in that session's specific folder. |
|
|
|
 |
|
|
|