Hi,
I'm currently porting a windows app to linux (must run on CentOS, RedHat and Ubuntu). At windows, I wrote some error-logs to %TEMP% path.
But what is the correct place for logfiles on Linux?
I try'd to write to /var/log/, but my app is not allowed to create a new file here (only root, but my app never runs with root permissions).
Can I use OpenFile() to write to some log that is declared for such use? For example stderr? But how can the user then see the content?
I'm new to Linux development and this is somewhat confusing.
Kukulkan
Where to store debug output?
-
remi_meier
- Enthusiast

- Posts: 468
- Joined: Sat Dec 20, 2003 6:19 pm
- Location: Switzerland
Re: Where to store debug output?
If you have a normal application you should probably log to
$HOME/.yourapp/
Syslog is normally used for System-relevant logs produced by
daemons or other critical applications (e.g. webservers). Syslog
writes to /var/log and can be used through a command-line tool
"logger" or through syslog-functions. Choose whatever works
best for you.
Cheers!
remi
$HOME/.yourapp/
Syslog is normally used for System-relevant logs produced by
daemons or other critical applications (e.g. webservers). Syslog
writes to /var/log and can be used through a command-line tool
"logger" or through syslog-functions. Choose whatever works
best for you.
Cheers!
remi
Athlon64 3700+, 1024MB Ram, Radeon X1600
Re: Where to store debug output?
Hi remi,
Thanks for your input. I think I will use $HOME/.app.
Kukulkan
Thanks for your input. I think I will use $HOME/.app.
Kukulkan
Re: Where to store debug output?
/tmp is also a place where you can create temporary files.
Re: Where to store debug output?
Yes, indeed a good idea. Thank you.
Re: Where to store debug output?
Hello,
Here on Linux Mint 12 :
Guimauve
Code: Select all
Debug GetTemporaryDirectory()I guess on windows this command return something likeDebugger Output wrote:/tmp/
Best regards.C:\Windows\Temp
Guimauve

