Logging in Photon

Options
TOADD
edited September 2014 in Photon Server
Hi,

i'm new to Photon technologies and i'm a bit stuck at the logging part.

First, i don't understand why the log4net.config of my application is rewritten each time i rebuild my application? How i'm suppose to make persistent configurations?

Next, it may seems simple but i can't manage to log to console, even if i use the correct appender, only in files seems to work.

Thanks for reading me!

Comments

  • chvetsov
    Options
    Hi, TOADD
    log4net.config is part of solution. You should change it there. When you change it, it will be copied to output folder

    About your second question:
    I do not know what is going on with your console. First of all you should have consle to see console output, if you do not log4net will not create consle for you, may be that is why you do not see anything
  • Thanks,

    but how can i make my photon application run a console at start so log4net can log to it?
  • chvetsov
    Options
    PhotonSocketServer is not console application.
    may be if you will start it from console, you will get what you want. But i'm not sure. use _run-Photon-as-application.start.cmd to start from console. probably, you will need to modify it

    Another question:
    Why do you need console? You could use file with BareTail or other log file viewer.
  • Thanks for pointing me out the fact that i could use a log file viewer, it perfectly feets my needs.

    Thanks again.
  • You can also log directly to a cloud-based log provider, this way you don’t have to manage log storage and parsing yourself and can search them MUCH easier. Loggly has a package for Log4net available here: https://www.loggly.com/docs/net-logs/.