Logs files are not created

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

tropyw
Posts: 9
Joined: 23 Jul 2020, 16:52
Contact:

Logs files are not created

Postby tropyw » 12 Sep 2020, 07:16

Hello,
In my server, there is only one log file (smartfox.txt) and there's no other logs from previous days. This file is reset at 00:00 every day.
I tried to check in the admin tool to see if there is anything wrong, and this is the configuration (I'm not sure it has anything to do with it):
Image
Am I missing something?
Thanks.
User avatar
Lapo
Site Admin
Posts: 21723
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Logs files are not created

Postby Lapo » 15 Sep 2020, 07:01

Hi,
tropyw wrote:Hello,
In my server, there is only one log file (smartfox.txt) and there's no other logs from previous days.


By default logs are generated under the SFS2X/logs/ folder and have a .log extension. It sounds like you have reconfigured the logging system. Although you didn't provide any details as to what changes you've made.

Let us know.
p.s. = the screenshot you have provided is not related with the log configurations.
See here --> http://docs2x.smartfoxserver.com/Gettin ... figuration
Lapo
--
gotoAndPlay()
...addicted to flash games
tropyw
Posts: 9
Joined: 23 Jul 2020, 16:52
Contact:

Re: Logs files are not created

Postby tropyw » 15 Sep 2020, 10:01

Thanks for your reply lapo.
I haven't changed anything. I thought it was .txt because it looked like a text file in it's default icon.
in my dev computer it works fine, but at the prod server it dosen't create files.
I wonder if it is related to some administrator permission to create those files (the location is C:\Users\Administrator\SmartFoxServer_2X\SFS2X\logs) although it is in the same location as my dev computer.

Screenshoot:
Image

log4j.properties:

Code: Select all

# ConsoleAppender
log4j.appender.consoleAppender=org.apache.log4j.ConsoleAppender
log4j.appender.consoleAppender.layout=org.apache.log4j.PatternLayout
log4j.appender.consoleAppender.layout.ConversionPattern=%d{HH:mm:ss,SSS} %-5p [%t] %c{2} %3x - %m%n

# SocketAppender
log4j.appender.socketAppender=org.apache.log4j.net.SocketAppender
log4j.appender.socketAppender.remoteHost=localhost
log4j.appender.socketAppender.port=4445
log4j.appender.socketAppender.locationInfo=true

# Regular FileAppender
# NOTE: altering the ConversionPattern will cause a portion of the AdminTool's Log Viewer module to stop working properly
log4j.appender.fileAppender=org.apache.log4j.DailyRollingFileAppender
log4j.appender.fileAppender.layout=org.apache.log4j.PatternLayout
log4j.appender.fileAppender.File=logs/smartfox.log
log4j.appender.fileAppender.layout.ConversionPattern=%d{dd MMM yyyy | HH:mm:ss,SSS} | %-5p | %t | %c{3} | %3x | %m%n
log4j.appender.fileAppender.Encoding=UTF-8

# The file is rolled over every day.
# Other examples:
#
# '.'yyyy-MM-dd-HH         rolls every hour
# '.'yyyy-MM-dd-HH-mm      rolls every minute
log4j.appender.fileAppender.DatePattern='.'yyyy-MM-dd


# BootLogger FileAppender(s)
log4j.appender.bootFileAppender=org.apache.log4j.DailyRollingFileAppender
log4j.appender.bootFileAppender.layout=org.apache.log4j.PatternLayout
log4j.appender.bootFileAppender.File=logs/boot/boot.log
log4j.appender.bootConsoleAppender.threshold=DEBUG
log4j.appender.bootFileAppender.layout.ConversionPattern=%d{dd MMM yyyy | HH:mm:ss,SSS} | %-5p | %t | %c{3} | %3x | %m%n
log4j.appender.bootFileAppender.Encoding=UTF-8

log4j.appender.bootConsoleAppender=org.apache.log4j.ConsoleAppender
log4j.appender.bootConsoleAppender.layout=org.apache.log4j.PatternLayout
log4j.appender.bootConsoleAppender.layout.ConversionPattern=%d{HH:mm:ss,SSS} %-5p [%t] %c{3} %3x - %m%n
log4j.appender.bootConsoleAppender.threshold=WARN


# log4j.category.com.smartfoxserver.v2=DEBUG,consoleAppender,fileAppender,socketAppender
log4j.category.com.smartfoxserver=INFO,consoleAppender,fileAppender
log4j.category.org.apache=INFO,consoleAppender,fileAppender
log4j.category.org.apache.http=INFO,consoleAppender,fileAppender
log4j.category.org.eclipse.jetty=WARN,consoleAppender,fileAppender
log4j.category.bootLogger=DEBUG,bootFileAppender,bootConsoleAppender
log4j.category.sfs2x=INFO,consoleAppender,fileAppender
log4j.category.Extensions=INFO,consoleAppender,fileAppender
log4j.category.hsqldb.db=WARN,consoleAppender,fileAppender
log4j.category.jndi=INFO,consoleAppender,fileAppender
User avatar
Lapo
Site Admin
Posts: 21723
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Logs files are not created

Postby Lapo » 15 Sep 2020, 13:05

Hi,
yes it sounds very much like a permission problem. The fact that the server is installed under an "Administrator" folder also doesn't look too good. Normally you just need to install it under a non-admin User folder (the one corresponding to the user installing it).

Try running the server by launching the SFS2X/sfs2x.bat script, this will output everything to the console, so issues with initializing the logs will show up as well.

Hope it helps
Lapo

--

gotoAndPlay()

...addicted to flash games
tropyw
Posts: 9
Joined: 23 Jul 2020, 16:52
Contact:

Re: Logs files are not created

Postby tropyw » 21 Sep 2020, 10:35

Yes, that's was the problem. Thank you!

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 28 guests