Before updating to Windows 10 you may need to return your Pro license. More information here

How do I write to the console?

I'm writing some C# scripts for a Windows Standalone application in Unity. I'd like to print some debug messages to the Unity console, but I can't figure out how. I've read that I should be able to do this using print(), Debug.Log, or System.Console.WriteLine(), but the first two just output to the log file, not the console, and the last doesn't appear to do anything at all.

I'm new to both Unity and C#, so don't hesitate to mention potential solutions that should be obvious enough for me to already have tried them :)

For the consolation prize...

As a workaround, I've been using BareTail to watch the log file, but it kinda sucks because Unity outputs the whole stack trace every time I print(). Any way for me to suppress that?

more ▼

asked Aug 17, 2010 at 10:05 PM

avatar image

188 6 9 18

(comments are locked)
10|3000 characters needed characters left

2 answers: sort oldest

It seems that the key piece of information I was missing was that Debug.Log writes to the console only when you run the game from within unity by pressing the "play" button above the game view.

I was running my game by pressing Ctrl-B, or pressing "Build & Run" in the Build Settings window. In that case, it will only output to the log file.

more ▼

answered Aug 26, 2010 at 09:18 PM

avatar image

188 6 9 18

Where is the log file?

Apr 18, 2013 at 04:56 PM hyliandanny

They are here

or here

Apr 18, 2013 at 06:13 PM Bunny83

They are here

or here

Is there really a need to be a jerk? Your suggestions are how I ended up here. Please consider consolidating useful information to a single location in the future instead of endorsing a distributed mess of incomplete steps.

For future searchers: the following link describes the location of the log file on multiple platforms. Worked for me on a mac.


Apr 18, 2013 at 06:34 PM hyliandanny

Unity has created a helpful page for where to find the log files on all the different platforms. You can find that page here:


Jun 18, 2013 at 06:33 PM spolglase
(comments are locked)
10|3000 characters needed characters left

print is an alias for Debug.Log, which does appear in the Unity console. There's also Debug.LogWarning and Debug.LogError, which (strangely enough) print lines labeled as warning and error messages. The latter is particularly useful if you have Error Pause selected in the console.

more ▼

answered Aug 17, 2010 at 10:28 PM

avatar image

121k 80 363 774

I'm not getting any output in the Unity console when I call Debug.Log

Aug 17, 2010 at 10:54 PM duggulous

Then your code probably isn't getting called.

Aug 18, 2010 at 01:00 AM Tetrad

The output IS showing up in the log file, so I know the code is being called.

Aug 18, 2010 at 02:10 PM duggulous

If is showing in log file and not showing in console you might have filters turned on (top right of console)

Jan 16, 2014 at 04:02 PM mikesx

I'm having the same problem. Neither debug.log nor console.writeline have ever worked for me. I use print, cause it works every time. I don't know why.

Jan 16 at 10:05 PM Kastenessen
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments



asked: Aug 17, 2010 at 10:05 PM

Seen: 101100 times

Last Updated: Jan 16 at 10:05 PM