I recently did in fact have a typo in my syslog.conf file, but I had no idea initially why I couldn't restart the daemon. In Ubuntu, all I seemed to get was a FAIL message after a rather long wait period.
Without it running properly, I was curious, is there a way I could have figured it out without scouring random logs pointlessly before considering there may have been a typo?
Edit: I really felt like using service to start/restart/etc the daemon should have given more than FAIL. Perhaps it does and I just don't know where to look, but if another service had a similar silly issue, I'd hope to be able to figure it out easily as well.
Best Answer
Probably the easiest way to do this would be to use
syslogd
's debug switch,-d
. You can invokesyslogd
manually like so.First disable any currently running
syslogd
:Then run it manually with the following switches:
Example
I don't have a working
syslogd
accessible but it would be very similar torsyslogd
. Here I'm invokingrsyslogd
:Testing
You can then use the command line tool
logger
to simulate messages of various types tosyslogd
. Again here I'm usingrsyslogd
as a stand in so the messaging will be different but the effect is still the same with either one.Sending a test message
Results
Log file's message
Another Example
Sample message
Results
This line contains our message
When you're done, simply Ctrl + C to terminate it.
References