Search Issue Tracker

Won't Fix

Won't Fix in 1.2.X

Votes

0

Found in [Package]

1.2.0-pre.4

Issue ID

ULOG-31

Regression

No

Logs only get written to Player.log when using WriteTo.StdOut

Package: Unity Logging

-

Reproduction steps:
1. Open the attached “test” project
2. Click File > Build Settings… > Build
3. Open the built Player directory
4. Launch Terminal in the built Player directory
5. Launch the built Player executable through the Terminal
6. Close Player
7. Observe Terminal output if it has output like this: “INFO || 2023-12-11 15:34:03.052 || Hello World”
8. Launch the built Player executable through the Terminal with “> logtest.log” added to the command
9. Open the “logtest.log” file and observe if it has output like this: “INFO || 2023-12-11 15:34:03.052 || Hello World”

Expected result: Unity Logging Package outputs logs to the terminal through StdOut
Actual result: Unity Logging Package only logs to the Player.log file

Reproducible with: 1.0.16, 1.2.0-pre.4 (2022.3.13f1, 2022.3.15f1, 2023.2.4f1, 2023.3.0a18)

Reproducible on: Ubuntu 22.04.3, Windows 10 Pro 21H2

  1. Resolution Note:

    This is actually the intended behavior. Unity has a not-really-documented behavior where it will redirect standard output to the Player.log file. Thus logging to standard output will log to that file. This redirection does not happen for headless platforms though, like server builds or builds running with the -batchmode command line parameter. Furthermore, it is possible to disable that redirection by passing the -logfile argument without specifying a file name.

  2. Resolution Note (1.2.X):

    This is actually the intended behavior. Unity has a not-really-documented behavior where it will redirect standard output to the Player.log file. Thus logging to standard output will log to that file. This redirection does not happen for headless platforms though, like server builds or builds running with the -batchmode command line parameter. Furthermore, it is possible to disable that redirection by passing the -logfile argument without specifying a file name.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.