I would like to separate out the log file by extension. For example:
I have 2 zone MyZone1 and MyZone2. I have a smartfox.log contain all log messages. I would like to config the log4j to filter out the smartfox.log file to MyZone1.log and MyZone2.log to contain only those log come from the zone. There is also MyZone3, MyZone4 can be added at run time and I would like to have a log file for MyZone3 .log and MyZone4.log too after adding the zone.
I would like to ask: Can Smartfox Server able to do that and if it can how could I archive it? Incase it's imposible is there any alternative way?
Custom Log File
-
- Posts: 19
- Joined: 01 Feb 2018, 04:33
Custom Log File
Sean Su
Mecury Studio
Mecury Studio
Re: Custom Log File
Hi,
yes it is possible. Take a look here: http://smartfoxserver.com/blog/custom-l ... xtensions/
Cheers
yes it is possible. Take a look here: http://smartfoxserver.com/blog/custom-l ... xtensions/
Cheers
-
- Posts: 19
- Joined: 01 Feb 2018, 04:33
Re: Custom Log File
Hi Lapo,
Follow the tutorial if I have 2 zones I need to config both in properties file. And every time I create a new zone I need to restart the server.
What I need is the server will not be restarted everytime new zone add in and the log file for new zone is create dynamically.
Thanks for your reply
Cheers
Follow the tutorial if I have 2 zones I need to config both in properties file. And every time I create a new zone I need to restart the server.
What I need is the server will not be restarted everytime new zone add in and the log file for new zone is create dynamically.
Thanks for your reply
Cheers
Sean Su
Mecury Studio
Mecury Studio
Re: Custom Log File
Hi,
sorry that's not possible. To change the logging configuration a restart is required.
sorry that's not possible. To change the logging configuration a restart is required.
-
- Posts: 19
- Joined: 01 Feb 2018, 04:33
Re: Custom Log File
Hi Lapo,
Let say I don't changing config at logging configuration. is there any custom way that I can have a separated log file for each extension? Do you have any suggestion?
Thanks
Let say I don't changing config at logging configuration. is there any custom way that I can have a separated log file for each extension? Do you have any suggestion?
Thanks
Sean Su
Mecury Studio
Mecury Studio
Re: Custom Log File
Maybe you can try to customize the logger at runtime, though I can't guarantee it will work as we've never tested it and I can't predict what could happen.
In any case Log4J is also configurable from code. You can take a look at their documentation and experiment in your Extension code. In theory you could configure each custom logger inside the init() method of each Extension running in your SmartFox.
Here's an article about configuring Log4J from code:
https://stackoverflow.com/questions/896 ... mmatically
hope it helps
In any case Log4J is also configurable from code. You can take a look at their documentation and experiment in your Extension code. In theory you could configure each custom logger inside the init() method of each Extension running in your SmartFox.
Here's an article about configuring Log4J from code:
https://stackoverflow.com/questions/896 ... mmatically
hope it helps
Who is online
Users browsing this forum: No registered users and 60 guests