How do I turn off Logging?

Post here your questions about the Java client / Android API for SFS2X

Moderators: Lapo, Bax

aspector247
Posts: 6
Joined: 11 Aug 2011, 18:39

How do I turn off Logging?

Postby aspector247 » 26 Jan 2012, 13:06

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
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 30 Jan 2012, 13:38

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
Full Control - maker of Unity/C# and Java SFS API and indie games
Follow on twitter: http://twitter.com/thomas_h_lund
User avatar
janheuninck
Posts: 68
Joined: 23 Nov 2011, 01:35
Location: Vancouver BC, Canada

Re: How do I turn off Logging?

Postby janheuninck » 01 Mar 2012, 23:20

I have the same problem. The console is being spammed with these info-messages, although the debug mode is set to false... Any solutions?
aspector247
Posts: 6
Joined: 11 Aug 2011, 18:39

Re: How do I turn off Logging?

Postby aspector247 » 02 Mar 2012, 16:26

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.
User avatar
janheuninck
Posts: 68
Joined: 23 Nov 2011, 01:35
Location: Vancouver BC, Canada

Re: How do I turn off Logging?

Postby janheuninck » 04 Mar 2012, 00:28

admins, is this a bug in the java api?
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Re: How do I turn off Logging?

Postby ThomasLund » 04 Mar 2012, 16:06

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
Full Control - maker of Unity/C# and Java SFS API and indie games

Follow on twitter: http://twitter.com/thomas_h_lund
User avatar
janheuninck
Posts: 68
Joined: 23 Nov 2011, 01:35
Location: Vancouver BC, Canada

Re: How do I turn off Logging?

Postby janheuninck » 05 Mar 2012, 17:52

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 >>>
dabur
Posts: 3
Joined: 23 Dec 2010, 09:25

Re: How do I turn off Logging?

Postby dabur » 03 Apr 2012, 10:25

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...
haplo
Posts: 78
Joined: 08 Jun 2010, 13:32

Re: How do I turn off Logging?

Postby haplo » 21 Apr 2012, 09:38

Any updates on thisone? how to lower the debug level?
dabur
Posts: 3
Joined: 23 Dec 2010, 09:25

Re: How do I turn off Logging?

Postby dabur » 15 May 2012, 10:37

temporarily I delete slf4j-simple-1.6.1.jar
its stop write logs ...
User avatar
Bax
Site Admin
Posts: 4608
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: How do I turn off Logging?

Postby Bax » 17 May 2012, 07:22

Did you install the latest API update from this page: http://www.smartfoxserver.com/download/sfs2x#p=updates
Still same issue?
Paolo Bax
The SmartFoxServer Team
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Re: How do I turn off Logging?

Postby ThomasLund » 17 May 2012, 15:14

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
Full Control - maker of Unity/C# and Java SFS API and indie games

Follow on twitter: http://twitter.com/thomas_h_lund

Return to “SFS2X Java / Android API”

Who is online

Users browsing this forum: No registered users and 6 guests