Author Topic: Server-Sided Chat Logger  (Read 1670 times)

I would like a server sided chat logger, because the only one I can find is client side which means I need to be on the server to track, having a server side would be useful to catch rule breakers if an admin is not present

When I get home I'll make it

Server_ChatLogging
let me know if you have any issues; it logs connections and chat/teamchat and also records them in 2 different places (blid and mashes them), they are recorded based on their date instead of 1 giant file in config/server/ChatLog/

Server_ChatLogging
let me know if you have any issues; it logs connections and chat/teamchat and also records them in 2 different places (blid and mashes them), they are recorded based on their date instead of 1 giant file in config/server/ChatLog/
Good features.  I will likely use this.

My one nitpick is that it creates and deletes a new fileobject for each chat message.
But that's just a personal thing.  I don't think such behavior will harm anything.

If I remember, if the server crashes when the file object is open for write it will be blank.

If I am wrong I will update it to help improve performance.

If I remember, if the server crashes when the file object is open for write it will be blank.
Ok. I tested it using crash() and that's true.

But openforappend doesn't delete the original content of the file.
So as long as you reopen and close the file each time you write a new line, you should be fine.

These were my test results:
Quote
new fileobject(fo);
fo.openforwrite("base/file.txt");
fo.writeline("Test1");
crash();
[]

new fileobject(fo);
fo.openforwrite("base/file.txt");
fo.writeline("Test1");
fo.close();
crash();
[Test1]

new fileobject(fo);
fo.openforwrite("base/file.txt");
fo.writeline("Test1");
fo.close();
fo.openforappend("base/file.txt");
fo.writeline("Test2");
crash();
[Test1]

new fileobject(fo);
fo.openforwrite("base/file.txt");
fo.writeline("Test1");
fo.close();
fo.openforappend("base/file.txt");
fo.writeline("Test2");
fo.close();
crash();
[Test1
Test2]

but does it actually do better in performance?

No, but it's safe and allows you to look at the file in realtime.

No, but it's safe and allows you to look at the file in realtime.
Mine does this too, I guess it's fine as it is then

You're already using append and closing it anyway. The only problem I see with yours is that it only stores it by ID. It would be nice to see the whole chat in one log, maybe by date, so that the context of what the person is saying is present.

You're already using append and closing it anyway. The only problem I see with yours is that it only stores it by ID. It would be nice to see the whole chat in one log, maybe by date, so that the context of what the person is saying is present.
Are you sure that it doesn't include all-in-one log by dates?
%path = $ChatLogger_FilePath @ %date @ ".txt";
%pathBLID = $ChatLogger_FilePath @ "BL_ID Log/" @ %bl_id @ "/" @ %date @ ".txt";

Ah, failed to catch that, skimmed too fast.