Page 1 of 1

Server side trace not working?

Posted: 25 Apr 2011, 18:20
by Sparticus
I used to be able to do this serverside :

trace("hello");

and it would print out to the server dos console (when running standalone).

Now it doesn't anymore... I did upgrade to the latest version recently so maybe that has something to do with it.

In the admin tool all the following are set to ON :

- use debug mode
- user friendly logging
- start extension file monitoring
- extension remote debug

Ideas?

Posted: 25 Apr 2011, 18:38
by Sparticus
I just found out the traces are appearing in the logs.... but not in the console...


it was nice to see it in the console as i'd rather not have to open the log constantly to see if anything new has been written to it

Posted: 26 Apr 2011, 08:39
by tchen
I haven't updated to RC2 yet, but you might want to check the log4j.properties to make sure that consoleAppender is still part of the output lines.

from my version

Code: Select all

log4j.category.com.smartfoxserver=INFO,consoleAppender,fileAppender
log4j.category.sfs.test=INFO,consoleAppender,fileAppender
log4j.category.org.apache.commons.vfs=INFO,consoleAppender,fileAppender
log4j.category.org.mortbay.log=WARN,consoleAppender,fileAppender
log4j.category.bootLogger=DEBUG,bootFileAppender,bootConsoleAppender
log4j.category.sfs2x=INFO,consoleAppender,fileAppender
log4j.category.Extensions=INFO,consoleAppender,fileAppender


Failing that, you could always use tail -f <filename> to view the log without reopening it every time there's a new line.

Posted: 17 Jul 2011, 13:15
by dingo
I just updated to RC3, now my traces are also missing in the console, but they're written to the log.

here's my log4j.properties:

Code: Select all

#log4j.category.com.smartfoxserver.v2=DEBUG,consoleAppender,fileAppender,socketAppender
log4j.category.com.smartfoxserver=INFO,consoleAppender,fileAppender
log4j.category.sfs.test=INFO,consoleAppender,fileAppender
log4j.category.org.apache.commons.vfs=INFO,consoleAppender,fileAppender
log4j.category.org.mortbay.log=WARN,consoleAppender,fileAppender
log4j.category.bootLogger=DEBUG,bootFileAppender,bootConsoleAppender
log4j.category.sfs2x=INFO,consoleAppender,fileAppender
log4j.category.Extensions=INFO,consoleAppender,fileAppender


any ideas what i need to change to fix this?

Posted: 17 Jul 2011, 15:10
by dingo
ok, seems to be working now.
perhaps because i wasn't using the sfs2x.bat file.

btw, just setup remote debugging, works great, but only when using the custom bat file as described by gabrielt:

viewtopic.php?t=11374

Re: Server side trace not working?

Posted: 07 Aug 2012, 00:32
by Carl Lydon
If I did a trace from another class besides my main class, all traces would stop (but no errors). Finally figured it out by calling a function on my main to do my traces.

Re: Server side trace not working?

Posted: 07 Aug 2012, 08:47
by Lapo
And super-unclear :)
Please provide the details so we can look into it and if it's a bug we will fix it.
Also make sure to use our latest version (2.2.0) before submitting bug reports. Thanks!

Re: Server side trace not working?

Posted: 07 Aug 2012, 17:51
by Carl Lydon
Sorry my post was unclear. Basically, I was having the same problem as the posters above. My traces were not appearing when I used the zone monitor in the admin tool. They would appear when I traced from my main extension class, but not from any other class. If I add a trace in any other class, my traces from the main class also become disabled.

I worked around the problem by calling a function in my main class that does the traces. Until I did this, I simply thought my cods was broken because I wasn't seeing the expected traces.

I will check today to see if the traces work in the log but not the zone monitor, as others people indicated above.

My version is 2.0.1. I downloaded the SFS2X just a few weeks ago so I was unaware that it was already out of date.