Log file settings
Log file settings
I installed Smartfox server on my centos and it is working properly. It has been configured with a 100 user license. We have the following log settings in our config.xml file.
<FileLoggingLevel>FINE</FileLoggingLevel>
<ConsoleLoggingLevel>WARNING</ConsoleLoggingLevel>
And the log file only shows the output like this format.
2008/03/12 12:51:29.426 - [ WARNING ] [id: 12] (SystemHandler.applyBadWordFilter): User: hot guy (x.x.x.x) is being kicked. Reason: swearing.
2008/03/12 12:53:19.179 - [ INFO ] [id: 11] (ConnectionCleanerTask.run): Disconneting idle user: HASAN
2008/03/12 12:53:19.179 - [ INFO ] [id: 11] (ConnectionCleanerTask.run): Disconneting idle user: linez
2008/03/12 12:55:19.182 - [ INFO ] [id: 11] (ConnectionCleanerTask.run): Disconneting idle user: fendi
I would like to know whether I can see the details of all users login to the smartfox server (including ip address) and the whole user activities details.
Regards,
Alias
<FileLoggingLevel>FINE</FileLoggingLevel>
<ConsoleLoggingLevel>WARNING</ConsoleLoggingLevel>
And the log file only shows the output like this format.
2008/03/12 12:51:29.426 - [ WARNING ] [id: 12] (SystemHandler.applyBadWordFilter): User: hot guy (x.x.x.x) is being kicked. Reason: swearing.
2008/03/12 12:53:19.179 - [ INFO ] [id: 11] (ConnectionCleanerTask.run): Disconneting idle user: HASAN
2008/03/12 12:53:19.179 - [ INFO ] [id: 11] (ConnectionCleanerTask.run): Disconneting idle user: linez
2008/03/12 12:55:19.182 - [ INFO ] [id: 11] (ConnectionCleanerTask.run): Disconneting idle user: fendi
I would like to know whether I can see the details of all users login to the smartfox server (including ip address) and the whole user activities details.
Regards,
Alias
The server logs various informations about user activities.
In order to make them appear in the log files you should choose which level the logger should use. By default we set it to INFO, which logs minimal activity and all errors. If you want you can change it to FINE or FINER to see more details.
One downside of this is that probably log files will grow larger very quickly.
You can configure all the details of the logging system by editing the Server/conf/wrapper.cfg file
In order to make them appear in the log files you should choose which level the logger should use. By default we set it to INFO, which logs minimal activity and all errors. If you want you can change it to FINE or FINER to see more details.
One downside of this is that probably log files will grow larger very quickly.
You can configure all the details of the logging system by editing the Server/conf/wrapper.cfg file
Thanks for your assistance.
I make the following changes in my conf/wrapper.conf file.
wrapper.console.loglevel=FINE
wrapper.logfile.loglevel=FINE
Following is the output shown in my /logs/wrapper_20080317.log
INFO | jvm 1 | 2008/03/17 11:11:44 | Received a packet PING : ping
INFO | jvm 1 | 2008/03/17 11:11:44 | Send a packet PING : ok
DEBUG | wrapperp | 2008/03/17 11:11:44 | read a packet PING : ok
DEBUG | wrapper | 2008/03/17 11:11:44 | Got ping response from JVM
DEBUG | wrapperp | 2008/03/17 11:11:48 | send a packet PING : ping
INFO | jvm 1 | 2008/03/17 11:11:48 | Received a packet PING : ping
INFO | jvm 1 | 2008/03/17 11:11:48 | Send a packet PING : ok
DEBUG | wrapperp | 2008/03/17 11:11:48 | read a packet PING : ok
DEBUG | wrapper | 2008/03/17 11:11:48 | Got ping response from JVM
It doesn't shows any details of user login to the system and ip adresses.
The following is the log settings in my config.xml file.
<FileLoggingLevel>FINE</FileLoggingLevel>
<ConsoleLoggingLevel>WARNING</ConsoleLoggingLevel>
NOTE: I installed smartfox server as a linux daemon.
Please check the above details and reply to me.
I make the following changes in my conf/wrapper.conf file.
wrapper.console.loglevel=FINE
wrapper.logfile.loglevel=FINE
Following is the output shown in my /logs/wrapper_20080317.log
INFO | jvm 1 | 2008/03/17 11:11:44 | Received a packet PING : ping
INFO | jvm 1 | 2008/03/17 11:11:44 | Send a packet PING : ok
DEBUG | wrapperp | 2008/03/17 11:11:44 | read a packet PING : ok
DEBUG | wrapper | 2008/03/17 11:11:44 | Got ping response from JVM
DEBUG | wrapperp | 2008/03/17 11:11:48 | send a packet PING : ping
INFO | jvm 1 | 2008/03/17 11:11:48 | Received a packet PING : ping
INFO | jvm 1 | 2008/03/17 11:11:48 | Send a packet PING : ok
DEBUG | wrapperp | 2008/03/17 11:11:48 | read a packet PING : ok
DEBUG | wrapper | 2008/03/17 11:11:48 | Got ping response from JVM
It doesn't shows any details of user login to the system and ip adresses.
The following is the log settings in my config.xml file.
<FileLoggingLevel>FINE</FileLoggingLevel>
<ConsoleLoggingLevel>WARNING</ConsoleLoggingLevel>
NOTE: I installed smartfox server as a linux daemon.
Please check the above details and reply to me.
Are you using a server-side custom login? If so you take control over the login procedure and it's up to you to login informations of the user login.
In a non custom-login zone you get this, if you set the logging level to FINE, when a user goes in and out:
In a non custom-login zone you get this, if you set the logging level to FINE, when a user goes in and out:
08:52:54.339 - [ FINE ] > User [ Mr.Lapo ] logged in
08:53:01.256 - [ FINE ] > User [ Mr.Lapo ] removed
I have the following doubt.
My config.xml file has the below mentioned line.
<FileLoggingLevel>FINE</FileLoggingLevel>
But the smartfox_log_0.txt still shows the logging level as INFO. You can check the output details here.
2008/03/17 14:28:16.625 - [ INFO ] [id: 11] (ConnectionCleanerTask.run): Disconneting idle user: HUNK
2008/03/17 14:28:16.625 - [ INFO ] [id: 11] (ConnectionCleanerTask.run): Disconneting idle user: pop1
2008/03/17 14:30:16.629 - [ INFO ] [id: 11] (ConnectionCleanerTask.run): Disconneting idle user: paolo
2008/03/17 14:30:41.874 - [ WARNING ] [id: 12] (EventWriter.handleEvent): Found user queues full: messages were dropped
Nothing related with FINE is on the output.
Why it is happening like this?
Regards,
Alias
My config.xml file has the below mentioned line.
<FileLoggingLevel>FINE</FileLoggingLevel>
But the smartfox_log_0.txt still shows the logging level as INFO. You can check the output details here.
2008/03/17 14:28:16.625 - [ INFO ] [id: 11] (ConnectionCleanerTask.run): Disconneting idle user: HUNK
2008/03/17 14:28:16.625 - [ INFO ] [id: 11] (ConnectionCleanerTask.run): Disconneting idle user: pop1
2008/03/17 14:30:16.629 - [ INFO ] [id: 11] (ConnectionCleanerTask.run): Disconneting idle user: paolo
2008/03/17 14:30:41.874 - [ WARNING ] [id: 12] (EventWriter.handleEvent): Found user queues full: messages were dropped
Nothing related with FINE is on the output.
Why it is happening like this?
Regards,
Alias
Solved via email.
There was a missing file called logging.properties.
In case someone has the same problem here's a quick work-around.
Open your favorite text editor, copy the following text into a new document and save it to the Server/ folder with the this name -> logging.properties
This file works as a global setting for the logging system.
You can change the logging level by altering this line:
There was a missing file called logging.properties.
In case someone has the same problem here's a quick work-around.
Open your favorite text editor, copy the following text into a new document and save it to the Server/ folder with the this name -> logging.properties
Code: Select all
############################################################
# Default Logging Configuration File
#
# You can use a different file by specifying a filename
# with the java.util.logging.config.file system property.
# For example java -Djava.util.logging.config.file=myfile
############################################################
############################################################
# Global properties
############################################################
# "handlers" specifies a comma separated list of log Handler
# classes. These handlers will be installed during VM startup.
# Note that these classes must be on the system classpath.
# By default we only configure a ConsoleHandler, which will only
# show messages at the INFO and above levels.
#handlers= java.util.logging.ConsoleHandler
# To also add the FileHandler, use the following line instead.
#handlers= java.util.logging.FileHandler, java.util.logging.ConsoleHandler
# Default global logging level.
# This specifies which kinds of events are logged across
# all loggers. For any given facility this global level
# can be overriden by a facility specific level
# Note that the ConsoleHandler also has a separate level
# setting to limit messages printed to the console.
.level= INFO
############################################################
# Handler specific properties.
# Describes specific configuration info for Handlers.
############################################################
# default file output is in user's home directory.
java.util.logging.FileHandler.pattern = %h/java%u.log
java.util.logging.FileHandler.limit = 50000
java.util.logging.FileHandler.count = 1
java.util.logging.FileHandler.formatter = java.util.logging.XMLFormatter
# Limit the message that are printed on the console to INFO and above.
java.util.logging.ConsoleHandler.level = INFO
java.util.logging.ConsoleHandler.formatter = it.gotoandplay.smartfoxserver.lib.SmartFoxSimpleLogFormatter
############################################################
# Facility specific properties.
# Provides extra control for each logger.
############################################################
# For example, set the com.xyz.foo logger to only log SEVERE
# messages:
it.gotoandplay.smartfoxserver.SmartFoxServer.level = FINESTYou can change the logging level by altering this line:
Code: Select all
.level= INFO-
praveen213
- Posts: 31
- Joined: 27 Dec 2010, 04:56
Re: Log file settings
is it possible to change the log level settings from info to fine when smartfoxserver is running. Is there a way by which we can we get this log setting changes in effect without restarting the server. ?
Re: Log file settings
Not at runtime, you will need a restart
-
Moonshine-ashish
- Posts: 7
- Joined: 21 Feb 2023, 13:07
Re: Log file settings
Hi Lapo,
I have multiple categories in the log4j.properties file like
log4j.category.in=INFO,consoleAppender
log4j.category.com=INFO,consoleAppender
Now I have 2 env QA and PROD for QA I want the log level to be DEBUG and the default should be INFO.
Will this be possible through server.xml?
If not any possible solution you can suggest.
I have multiple categories in the log4j.properties file like
log4j.category.in=INFO,consoleAppender
log4j.category.com=INFO,consoleAppender
Now I have 2 env QA and PROD for QA I want the log level to be DEBUG and the default should be INFO.
Will this be possible through server.xml?
If not any possible solution you can suggest.
Re: Log file settings
@Moonshine
isn't it just a matter of configuring the two log4j files differently for each environment?
If not, I am not sure I understand the question.
Cheers
isn't it just a matter of configuring the two log4j files differently for each environment?
If not, I am not sure I understand the question.
Cheers