Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Resolved [SOLVED] Where to Find Logs of a Built Game

Discussion in 'Editor & General Support' started by Swimmtrunk, Jan 6, 2023.

Thread Status:
Not open for further replies.
  1. Swimmtrunk

    Swimmtrunk

    Joined:
    May 27, 2021
    Posts:
    22
    Hello,

    I would say I'm fairly new to Unity still, but I've been working on this 4-player air hockey game for quite some time now (~5 months consecutively) and I've run into the problem of the game running fine in the Unity Editor, but once I've built the game, one of the key features is missing and I want to see if I can:

    1. Check bare logs of the built game (and see if objects aren't being assigned correctly, are missing, etc.)
    2. Make debug messages of my own to see if code is executing properly

    I am currently using Unity 2021.1.18 on Windows x64

    Where should I be looking to find debug notes/logs of a built version of my Unity game?

    Thank you for your time reading this!
     
    LongRamen, mwedu and Powsinoga like this.
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,954
    Google.
     
  3. Swimmtrunk

    Swimmtrunk

    Joined:
    May 27, 2021
    Posts:
    22
    Right, thanks... I've been searching for how to find these "logs" and saw that supposedly in Windows the logs are in a hidden file from %APPDATA% but haven't found any mention of a file (let alone a text file) related to logs. Additionally, within the project file there's also no mention of a log, or whatever it is I may be looking for.

    Perhaps this may be better: Does Unity have an option for viewing something like the console for when you've built your game?

    Both
    https://forum.unity.com/threads/using-debug-log-on-built-projects.452290/
    and
    https://answers.unity.com/questions/125049/is-there-any-way-to-view-the-console-in-a-build.html
    have given me no leeway into what I've tried to find.
     
    CloudyVR likes this.
  4. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    6,015
  5. Swimmtrunk

    Swimmtrunk

    Joined:
    May 27, 2021
    Posts:
    22
    Honestly, no. I have seen:

    "On Windows, a standard out stream doesn’t exist by default, so you must launch the Editor with a valid configured stdout stream, as a child process from a CI system. If you specify - to send output` to stdout`, then you won’t see the output in the console window."

    and sorry to disappoint, but I don't understand how to do this or if this is even what I'm looking for...

    As for what's immediately below, when I look into the Editor log type (Location: %LOCALAPPDATA%\Unity\Editor\Editor.log) I can most definitely see the logs of how the *editor* is booting, running, and shutting down, but not where I could see something like Debug.Log messages for myself

    That's all I want. I just want to see if a Debug.Log("message here") statement is printed when I have selected the "Build & Run" option for my game.
     
    CloudyVR likes this.
  6. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    6,015
    Your Debug.Logs are in there. Take a closer look.
     
  7. Swimmtrunk

    Swimmtrunk

    Joined:
    May 27, 2021
    Posts:
    22
    I'm really only seeing references to Debug.Log in lines such as this instead of the message I inserted:

    UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
    UnityEngine.Logger:Log (UnityEngine.LogType,object)
    UnityEngine.Debug:Log (object)

    I'll just continue to comb through my code, but appreciate the help until now. I'm clearly missing something, but I only know what I know and that's just making it even harder to find my answer. Sorry for any confusion thus far.
     
  8. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    6,015
    Once again, they're in there. I wouldn't be saying it if I wasn't sure.
     
    ArthurVanRemoortel likes this.
  9. Swimmtrunk

    Swimmtrunk

    Joined:
    May 27, 2021
    Posts:
    22
    I'm aware of this. The previous reply was meant to explain that the mistake is likely in my own code rather than in your explanation.
     
  10. tleylan

    tleylan

    Joined:
    Jun 17, 2020
    Posts:
    531
    Let's rewind and see if we can figure this out. You're running Windows right? So you using the paths outlined for Windows. And you see the editor logs right? But as you point out this is only for the editor (and a few other categories that are editor-related). App logs shouldn't write there because it would get confusing with lots of apps.

    So do you have the project setup correctly such that a folder would exist to hold debug statements? And do you at least see the folders on your machine?

    Code (CSharp):
    1. %USERPROFILE%\AppData\LocalLow\CompanyName\ProductName\Player.log
    And when your app starts somewhere near the startup you've added something like Debug.Log("ta da"); And you see this in the console?
     
  11. Swimmtrunk

    Swimmtrunk

    Joined:
    May 27, 2021
    Posts:
    22
    This is precisely what I was looking for! The messages are there, and I can also see that the sounds aren't being found, which is leading to the main problem I'm having. I think I know where I can go from here! Thanks a ton!
     
    Last edited: Jan 7, 2023
    VOTRUBEC and Kurt-Dekker like this.
  12. d23z

    d23z

    Joined:
    May 24, 2021
    Posts:
    1
    This response is not helpful. This is a top google result when searching for information about Unity logging. It would be better to not answer at all than to give a response like this.
     
  13. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    6,015
    Googling 'Unity Log File Locations' gets the documentation on log files as the top result. Google was a reasonable response.
     
  14. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    9,996
    Please do not respond to mindless necros, just report them so mods can delete them.
     
Thread Status:
Not open for further replies.