Page 1 of 1

How do I turn off Logging?

Posted: 26 Jan 2012, 13:06
by aspector247
I'm loadtesting my application right now by creating a java client that logs X number of users into the system. The problem right now is that my machine runs out of memory from all the log statements being printed out.

........
609 [New I/O client worker #1-1] INFO sfs2x.client.core.EventDispatcher - Dispatching event connect to 1 listeners
593 [New I/O client worker #2-1] INFO sfs2x.client.core.EventDispatcher - Dispatching event OnConnect to 1 listeners
625 [New I/O client worker #2-1] INFO sfs2x.client.core.EventDispatcher - Dispatching event connect to 1 listeners
.........

I have debug set to false in both my configuration file and when creating a new SmartFox(false) instance and even tried using setDebug(false);

Any ideas how to turn all these INFO messages off would be a lot of help.
Thanks!
Adam

Posted: 30 Jan 2012, 13:38
by ThomasLund
The log could be turned off via the logger class itself that you feed the API.

Or by binding it to a SLF4J log implementation that disregards all logs (NOP module). Or the log4j binding that can be detailed controlled. Etc

But yeah - that particular piece of code would be super spammy in your situation - and doesnt have a "is debug check". I'll try to see if its possible for that to check for the debug flag. Uncertain I have easy access to it though from that particular spot :-/

/Thomas

Re: How do I turn off Logging?

Posted: 01 Mar 2012, 23:20
by janheuninck
I have the same problem. The console is being spammed with these info-messages, although the debug mode is set to false... Any solutions?

Re: How do I turn off Logging?

Posted: 02 Mar 2012, 16:26
by aspector247
I ended up making my load test client in flash only because it was a lot easier for me to control. I have it set up so I can load in CSV files from the database and run tests such as login the first 100 users every .5 seconds and record the how long it takes to retrieve their friends.
I can turn off logging in the flash client and if I do run out of memory which happens at around 1000 users on my system I can just split the load on multiple browsers - run 1-1000 clients in browser a, 1001-2000 clients in browser b, etc.
Hope this helps.

Re: How do I turn off Logging?

Posted: 04 Mar 2012, 00:28
by janheuninck
admins, is this a bug in the java api?

Re: How do I turn off Logging?

Posted: 04 Mar 2012, 16:06
by ThomasLund
In the 1.0 release, that particular line of code (the log message) was removed.

So should not be present there anymore - it was not controlled by log level settings, so thats why it keps spamming.

If you still have some error here when using 1.0 version API, then poke me

/Thomas

Re: How do I turn off Logging?

Posted: 05 Mar 2012, 17:52
by janheuninck
ThomasLund wrote:In the 1.0 release, that particular line of code (the log message) was removed.

So should not be present there anymore - it was not controlled by log level settings, so thats why it keps spamming.

If you still have some error here when using 1.0 version API, then poke me

/Thomas


I'm using the latest libraries, but I still get the info messages in the console:

Code: Select all

run:
73 [main] INFO sfs2x.client.core.EventDispatcher - Dispatching event configLoadSuccess to 1 listeners
146 [New I/O client worker #1-1] INFO sfs2x.client.core.EventDispatcher - Dispatching event OnConnect to 1 listeners
146 [New I/O client worker #1-1] INFO sfs2x.client.core.EventDispatcher - Dispatching event connect to 1 listeners
176 [New I/O client worker #1-1] INFO sfs2x.client.core.EventDispatcher - Dispatching event OnData to 1 listeners
176 [New I/O client worker #1-1] INFO sfs2x.client.core.SFSIOHandler - Handling New Packet of size 80
177 [New I/O client worker #1-1] INFO sfs2x.client.core.SFSIOHandler - Handling Header Size. Length: 79 (small)
177 [New I/O client worker #1-1] INFO sfs2x.client.core.SFSIOHandler - Data size is 77
177 [New I/O client worker #1-1] INFO sfs2x.client.core.SFSIOHandler - Handling Data: 77, previous state: 0/77
177 [New I/O client worker #1-1] INFO sfs2x.client.core.SFSIOHandler - <<< Packet Complete >>>

Re: How do I turn off Logging?

Posted: 03 Apr 2012, 10:25
by dabur
I have the same problem...

I can't down log level

Code: Select all

150845 [New I/O client worker #1-1] INFO sfs2x.client.core.SFSIOHandler - <<< Packet Complete >>>
150846 [New I/O client worker #1-1] INFO sfs2x.client.core.EventDispatcher - Dispatching event extensionResponse to 1 listeners
180848 [New I/O client worker #1-1] INFO sfs2x.client.core.EventDispatcher - Dispatching event OnData to 1 listeners
180848 [New I/O client worker #1-1] INFO sfs2x.client.core.SFSIOHandler - Handling New Packet of size 59
180849 [New I/O client worker #1-1] INFO sfs2x.client.core.SFSIOHandler - Handling Header Size. Length: 58 (small)
180849 [New I/O client worker #1-1] INFO sfs2x.client.core.SFSIOHandler - Data size is 56
180849 [New I/O client worker #1-1] INFO sfs2x.client.core.SFSIOHandler - Handling Data: 56, previous state: 0/56
180849 [New I/O client worker #1-1] INFO sfs2x.client.core.SFSIOHandler - <<< Packet Complete >>>
180849 [New I/O client worker #1-1] INFO sfs2x.client.core.EventDispatcher - Dispatching event extensionResponse to 1 listeners


help...

Re: How do I turn off Logging?

Posted: 21 Apr 2012, 09:38
by haplo
Any updates on thisone? how to lower the debug level?

Re: How do I turn off Logging?

Posted: 15 May 2012, 10:37
by dabur
temporarily I delete slf4j-simple-1.6.1.jar
its stop write logs ...

Re: How do I turn off Logging?

Posted: 17 May 2012, 07:22
by Bax
Did you install the latest API update from this page: http://www.smartfoxserver.com/download/sfs2x#p=updates
Still same issue?

Re: How do I turn off Logging?

Posted: 17 May 2012, 15:14
by ThomasLund
There is mixed up confusion about the initial "log messages that are not controlled by the logger" and normal logging messages.

The stray leftover debug message has been removed. Whats left is regular logged messages.

As written some months ago SLF4J can switch backends for handling the log messages. The slf4j-simple logger backend cannot control the log level. You need to swap it to for example log4j backend. Then you can use regular log4j configuration files for controlling your log message flow.

/Thomas