Syslog facility

G

greg

Hi All,

I am having trouble with pointing the syslog messages to a particular
facility. Is this the right way to point it at facility local1:

Syslog.open('name_of_prog', facility = Syslog::LOG_LOCAL1)
Syslog.log(Syslog::LOG_NOTICE, "message_goes_here")
Syslog.close

I would really appreciate your help!

Thanks,
Greg
 
W

Will Parsons

greg said:
Hi All,

I am having trouble with pointing the syslog messages to a particular
facility. Is this the right way to point it at facility local1:

Syslog.open('name_of_prog', facility = Syslog::LOG_LOCAL1)
Syslog.log(Syslog::LOG_NOTICE, "message_goes_here")
Syslog.close

I would really appreciate your help!

The way I do it is:
-----
require 'syslog'
....
$log = Syslog.open('progname', Syslog::LOG_PID, Syslog::LOG_LOCAL1)
....
$log.info("messsage")
 
G

greg

Exactly what I needed! Thanks!

I closed the log with `Syslog::close'. Is this the way you do it?

Thanks in advance!
 
W

Will Parsons

greg said:
Exactly what I needed! Thanks!

I closed the log with `Syslog::close'. Is this the way you do it?

Thanks in advance!
I don't bother. I generally use syslog with programs that run indefinitely
and want the logging to continue until the system is rebooted or the
process is terminated on purpose.
 
C

Craig Beck

-----
require 'syslog'
...
$log = Syslog.open('progname', Syslog::LOG_PID, Syslog::LOG_LOCAL1)
...
$log.info("messsage")
------

Does anyone know if this works on OS X? Where would I look for the
output?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top