Log4net not working properly

Options
vitorcmaia
edited August 2012 in Photon Server
I don't know if this problem is related to Photon, but I'll ask it here anyway. I use log4net to tell me some logs of my application. Everything goes to a "debug.log", in the server machine. With Photon 2, the file was updated properly, in every execution. But after I updated to Photon 3, it only updates the file sometimes. If I execute the application and the log keeps empty, I just recompile the code, without changes, and the log returns to update.

Who's responsible for this bug, me, Photon or log4net?

Comments

  • That's hard to tell, we need a few more infos.

    You mentioned that recompilation has an effect - so I wonder if you are perhaps logging to the same debug.log file from multiple instances of your application.

    If you look into your PhotonServer.config, do you have "EnableAutoRestart=true" set for your app? This means: if you recompile the app, Photon loads the new instance of the app, but the old instance of the app stays alive as long as there are connections. Maybe it locks the log file so that the new instance can not access it? Try to change to "ForceAutoRestart=true" - in this case, the app will shutdown immediately and should free the log file.

    If this doesn't help, can you please..
    - send me your PhotonServer.config + log4net.config
    - reproduce the behaviour and send me the Photon-Default... + PhotonCLR.log + your application log (so that I can see where it's working and where not).

    Let me know if you find a solution or if you need further help!