How to log properly in Unity?

Hi, I would like to add proper file logging to my Unity game.

AFAIK Debug.Log, Debug.LogError, etc only work in debug mode and they only log to the Console. However I found that I can register a LogCallback function via a static method in Application.

If I register such a callback, how do I call it? I see that the Application class has a private static CallLogCallback function, which does this, but since it is private, it is not much of use. I also did not find any calls to that private static function.

Use Debug.Log, it is proper file logging and works all the time, as long as you have “use player log” active in the player settings.