Quantcast
Channel: Photon Server — Photon Engine
Viewing all articles
Browse latest Browse all 1557

How to setup the logging properly?

$
0
0
Hello!

I've set up a self-hosted photon server. I've added tutorial ChatServer application. And it all seems fine.
Then I've wanted to add the logging to a server code. I've used the tutorial again (as far as I understood it), so:
1. I've added ExitGames.Logging.Log4Net.dll and log4net.dll to the ChatServer project.
2. I've put log4net.config into the bin directory of the ChatServer
3. I've put the tutorial config to the log4net.config

4. I've added this code the ChatPeer.cs
using ExitGames.Logging;
using ExitGames.Logging.Log4Net;
...
private static readonly ILogger log = LogManager.GetCurrentClassLogger();
5. And I want to use the logger like this:
log.DebugFormat("{0}", "Some debug");
log.InfoFormat("{0}", "Or some info");

But there is nothing printed to any files and log.IsDebugEnabled(or any other level) returns false.
I'm sure I've missed something. Could you please explain to me how to configure the logging properly?

Thanks a lot!

Viewing all articles
Browse latest Browse all 1557