Page 1 of 1

Logging. Trace isn't enogh

Posted: 02 Aug 2011, 09:09
by BadUser
Hello. I'm sure this question is descriped somewhere, but still.
I wan't to make my own logging. How can i do that? i know that creating a file and write it on your own isn't a solution. So, please explain how to make it work/

Posted: 02 Aug 2011, 21:41
by BigFIsh

Posted: 03 Aug 2011, 08:59
by BadUser
Thanks, but i don't see how to make my own log file.
That example will put my log messages to general log-file for server, what about my own? F. e. i've created an extension and i want to make log file just for it

Posted: 03 Aug 2011, 09:15
by BadUser
I've found writeFile. I think that's what i need.
but ExtensionHelper.instance().writeFile() doesn't exists. Should i import some libraries?

Posted: 03 Aug 2011, 19:23
by BigFIsh
I assume you're using Java for your extensions. If that's the case, you can use java's IO library to write text to an external file.

See http://www.roseindia.net/java/example/j ... file.shtml

Posted: 04 Aug 2011, 07:56
by BadUser
Yes, i thought about that, but i think may be i missed something. it's unsafe to use file operations by myself, so.
Anyway, there's no more option i guess, so thanks for clearing.

Posted: 05 Aug 2011, 15:30
by Sarevok
You can always use external logging facility such as log4j. It is thread safe, and it works for me very nicely. With log4j I create different log file for every game room.