Logging. Trace isn't enogh

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

BadUser
Posts: 10
Joined: 11 Jul 2011, 08:40

Logging. Trace isn't enogh

Postby BadUser » 02 Aug 2011, 09:09

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/
User avatar
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Postby BigFIsh » 02 Aug 2011, 21:41

Smartfox's forum is my daily newspaper.
BadUser
Posts: 10
Joined: 11 Jul 2011, 08:40

Postby BadUser » 03 Aug 2011, 08:59


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
BadUser
Posts: 10
Joined: 11 Jul 2011, 08:40

Postby BadUser » 03 Aug 2011, 09:15

I've found writeFile. I think that's what i need.
but ExtensionHelper.instance().writeFile() doesn't exists. Should i import some libraries?
User avatar
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Postby BigFIsh » 03 Aug 2011, 19:23

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/java/io/java-write-to-file.shtml
Smartfox's forum is my daily newspaper.
BadUser
Posts: 10
Joined: 11 Jul 2011, 08:40

Postby BadUser » 04 Aug 2011, 07:56

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.
Sarevok
Posts: 75
Joined: 12 Apr 2011, 22:12

Postby Sarevok » 05 Aug 2011, 15:30

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.

Return to “Server Side Extension Development”

Who is online

Users browsing this forum: No registered users and 38 guests