Logging error messages in a Daemon program
- From: mshetty@xxxxxxxx
- Date: 29 Dec 2005 07:17:40 -0800
Hi,
I am converting an existing application into a daemon program. I have a
query on error message logging. Since the application creates daily
logs its does not use syslog, instead all message a logged in a log
file.
I am trying to figure out the best way to inform the user of an error,
under conditions where the application is not able to open/create a log
file.
One of the ways I found on the net is to re-direct it to /dev/console.
Are there any other ways of doing it?
Currently I am not closing stderr. Incase log file open fails all error
messages are directed to stderr. While running the daemon I redirect
stderr to a file.
What problems could arise on doing this? (other than losing messages
when stderr is not redirected)
Would help if I could some input on the above.
Thanks and Regards,
M Shetty
.
- Prev by Date: Re: program hangs after calling exit
- Next by Date: Re: glibc 2.2 vs 2.3 issue back again
- Previous by thread: Is the libguile plus Scheme best partner for a program with script built-in?
- Next by thread: Have released a preliminary of NewsFleX newsreader that has encrypted anonymous communication via the headers.
- Index(es):
Relevant Pages
|