[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Syslog facility

greg

8/31/2007 6:02:00 AM

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

4 Answers

Will Parsons

9/1/2007 1:13:00 AM

0

greg wrote:
> 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")
------

--
Will

greg

9/1/2007 2:32:00 AM

0

Exactly what I needed! Thanks!

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

Thanks in advance!


Will Parsons

9/1/2007 1:00:00 PM

0

greg wrote:
> 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.

--
Will

Craig Beck

9/2/2007 8:03:00 PM

0


> -----
> 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?

--
Craig Beck

AIM: kreiggers