Currently, I use Path.GetTempPath() to figure out where to write my log files, but recently I came across a user\'s machine where the path returned was not what
Path.GetTempPath()
If you are using C# on MacOS using Mono Framework then value returned by Path.GetTempPath() is value of environment variable TMPDIR.
C#
MacOS
Mono Framework
TMPDIR
Running echo $TMPDIR usually returns value like :
echo $TMPDIR
/var/folders/{2 character random-string}/{random-string}/T