Logging configuration for Loadbalancer
Options
jashan
✭✭
I'm having a little bit of trouble configuring logging for the Loadbalancer server. In Game.cs, I have added on top of the class:
In HandleJoinOperation, I have a log statement like:
Now, when I switch this to FatalFormat, I do get my logging statement. So in principle, this works. When I change the log4net.config so that OperationData is on "DEBUG", log4net spams the logfile - so changing the configuration also seems to work properly. However, I've added:
This doesn't seem to have an effect. Also, I've changed the level defined in root to DEBUG. Doesn't seem to have an effect, either.
Any ideas what I'm missing here?
private static log4net.ILog log = log4net.LogManager.GetLogger(typeof(Game));
In HandleJoinOperation, I have a log statement like:
log.DebugFormat("HandleJoinOperation(...)", ...);
Now, when I switch this to FatalFormat, I do get my logging statement. So in principle, this works. When I change the log4net.config so that OperationData is on "DEBUG", log4net spams the logfile - so changing the configuration also seems to work properly. However, I've added:
<logger name="Photon.LoadBalancing.GameServer.Game"> <level value="DEBUG" /> </logger>
This doesn't seem to have an effect. Also, I've changed the level defined in root to DEBUG. Doesn't seem to have an effect, either.
Any ideas what I'm missing here?
0
Comments
-
The logger name usually equals namespace + class of the class that configured the logger (OperationData is an exception). Is there a logger instance in "Photon.LoadBalancing.GameServer.Game"?0
-
Another idea: do you have a <filter> element defined in your appender?0
-
Boris wrote:The logger name usually equals namespace + class of the class that configured the logger (OperationData is an exception). Is there a logger instance in "Photon.LoadBalancing.GameServer.Game"?
Yes. When I use log.FatalFormat instead of log.DebugFormat I get2011-09-29 15:58:52,116 [8] FATAL Photon.LoadBalancing.GameServer.Game [(null)] - Game.HandleJoinOperation(local=192.168.0.101:5057, remote=192.168.0.100:58663, Lite.Operations.JoinRequest, Photon.SocketServer.SendParameters)
in the log, Photon.LoadBalancing.GameServer.Game being the fully qualified class name.0 -
Nicole wrote:Another idea: do you have a <filter> element defined in your appender?
No, it's the default configuration file that comes with the Loadbalancer apps. No <filter> in LogFileAppender there. But I think I found out now what the problem was - actually a combination of two things:
a) GameServer1 has one log4net.config, GameServer2 another one. You can guess the rest ;-)
b) During my experiments, at some point I added additivity="false" to my logger without really know what I was doing ;-) (I had never used this before) ... that combined with a) probably made me miss the times when the log statement actually came through.
I've disabled Game2 for now ... seems like having Loadbalancing in the equation makes things more complex than I need for now. Another question coming up ... for a separate thread ;-)0