How to log and debug

The whole answer can be found below.

Please note: The Photon forum is closed permanently. After many dedicated years of service we have made the decision to retire our forum and switch to read-only: we've saved the best to last! And we offer you support through these channels:

Try Our
Documentation

Please check if you can find an answer in our extensive documentation on Photon Server.

Join Us
on Discord

Meet and talk to our staff and the entire Photon-Community via Discord.

Read More on
Stack Overflow

Find more information on Stack Overflow (for Circle members only).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

How to log and debug

Rumman
2018-08-29 09:08:27

In unity I simple write "Debug.Log(string)", it shows me the string content in the console. In eclipse for appwarp, I use System.PrintIn(string), it shows me the content as soon as I run the java content right from the editor. How to do similar logging and debugging in photon server code?

Comments

JohnTube
2018-08-29 13:53:17

Hi @Rumman,

Thank you for choosing Photon!

We use log4net for logging in the server SDK.
You could read more about logging on this page.

Rumman
2018-08-30 03:56:39

@JohnTube wrote:

Hi @Rumman,

Thank you for choosing Photon!

We use log4net for logging in the server SDK.
You could read more about logging on this page.

OMG! that's horrible! Is there no user friendly solution so that I hit F5 on VS, server deploys, server runs, and I can see the log right in a console? :/

chvetsov
2018-08-30 09:09:18

of course, there are.
but please do not spend our time teaching you logging. I'm sure you are intelligent enough to discover it your self. Look for Appenders

But because we do not use the console, it could be that you will not see anything. We usually use log files

best,
ilya

Rumman
2018-08-30 09:22:31

@chvetsov wrote:

of course, there are.
but please do not spend our time teaching you logging. I'm sure you are intelligent enough to discover it your self.

Well my loggers are up and running now, ended up using serilog anyway.
People can be intelligent enough to make a socket server too, if that matters in such extent. That's not the point, we use tools/tech/third-party library to save our production time NOT because we can not make them ourselves. Its not something we can or can not, its something we should or should not. Thanks for your tips and I hope photon will be mature enough someday to enable robust debugging and logging, so will its forum mods. :)

chvetsov
2018-08-31 08:31:14

Hi, @Rumman
One day you will find how odd sounds all that you wrote.
We did not ask you to write your own logging. All that we asked you just to learn how to use the log4net framework which used by our server-side code.

We are mature enough to not write logging libs our self and to not ask our customers to do so :smile:

best,
ilya

graeme
2022-07-20 21:36:54

I understand the question and would like to answer for future starting programmers:

  • Use one of the following in your quantum code, either should work

    Log.Write("write something");
    Log.Debug(input->MouseDirection.ToString());

  • Run the code in Debug mode from your IDE

    • In Rider, I click the Debug bug at the top right.

    • Ignore any break-points that pop up in the code at this time

  • Start the Unity program

  • The Console messages should show up in Unity's console now! (Not the coding IDE's.)

Hope this helps anyone who got confused like I did!

Back to top