[Solved] How to stop logging PeerBase SentEvent?

lazalong
edited September 2011 in Photon Server
Hey

In the loadbalancing as long as the game severs are up they will send event evCode=1 to the master server. This is ok to keep the servers alive.

However I would like to stop filling my logs with endless lines of:
....
2011-09-29 12:06:42,468 [14] DEBUG Photon.SocketServer.PeerBase - SentEvent: ConnID=4, evCode=1, ChannelId=0, result=Ok size=18 bytes
2011-09-29 12:06:43,468 [14] DEBUG Photon.SocketServer.PeerBase - SentEvent: ConnID=4, evCode=1, ChannelId=0, result=Ok size=18 bytes
2011-09-29 12:06:44,468 [16] DEBUG Photon.SocketServer.PeerBase - SentEvent: ConnID=4, evCode=1, ChannelId=0, result=Ok size=18 bytes
...

Is there a way I can stop logging this event but still be able to log other DEBUG level messages?
Because if I set the log4net <root> to INFO I can't log my own debug messages and setting the logger name="OperationData" to INFO doesn't work as I thought.

Any idea?

Comments

  • Hi Lazalong,

    besides the "root" element, which defines the default log level, you can use "logger" elements to define the log level for individual classes. To set the log level for the PeerBase class to "Info", use this:
     &lt;logger name="Photon.SocketServer.PeerBase"&gt;
        &lt;level value="INFO" /&gt;
    &lt;/logger&gt;
    

    You could also set the root to INFO and define DEBUG-level loggers for your own classes instead.

    Have a look at the lo4net documentation at http://logging.apache.org/log4net/relea ... ation.html for more info.
  • Thanks this works perfectly.