UnityRef is currently in early development. Some features may be incomplete and/or not functioning.

UNITYREF

Your Pit Stop For Solving ANYTHING in Unity

architecture

[Logging] UNITY_EXT_LOGGING Fails Timestamps in Builds

Under Audit

lightingtilemapsdebugging

Unity 2022.3.x - Unity 2022.3.x

Published Tue, Mar 10

Attempts to enable timestamps in the player .log file using the UNITY_EXT_LOGGING environment variable via Environment.SetEnvironmentVariable are ineffective, even when targeting different scopes.

Issue

 Setting the UNITY_EXT_LOGGING environment variable to '1' using Environment.SetEnvironmentVariable does not enable timestamps in the player .log file. This behavior is observed regardless of whether the variable is set for the current process, user, or machine, indicating that the Environment.SetEnvironmentVariable method may not be effectively propagating the UNITY_EXT_LOGGING setting to the player process, or the player build is not respecting the variable as expected.

Experimental Fixes
  • Set the UNITY_EXT_LOGGING environment variable directly at the operating system level (e.g., using system environment variable settings) before launching the player executable.
  • Inspect the player’s log file for any other configuration entries or errors that might indicate an overridden logging setting or an issue with the log file’s write permissions.
  • Utilize a custom logging system within your project that provides granular control over log message formatting, including timestamps.

Editor's Note:

The above fixes have not been verified by our audit team yet. They are provided exclusively for your own technical research. We recommend creating a backup of your project before proceeding with any attempts. Utilize at your own discretion!

Related Posts Haven't quite found a solution to your problem? We think these posts might help you.

Content inspired by a Unity discussion post.