Syslog facility

Discussion in 'Ruby' started by greg, Aug 31, 2007.

  1. greg

    greg Guest

    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
    greg, Aug 31, 2007
    #1
    1. Advertising

  2. greg

    Will Parsons Guest

    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
    Will Parsons, Sep 1, 2007
    #2
    1. Advertising

  3. greg

    greg Guest

    Exactly what I needed! Thanks!

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

    Thanks in advance!
    greg, Sep 1, 2007
    #3
  4. greg

    Will Parsons Guest

    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
    Will Parsons, Sep 1, 2007
    #4
  5. greg

    Craig Beck Guest


    > -----
    > 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
    Craig Beck, Sep 2, 2007
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rashmi Panduranga

    Facility favored or not?

    Rashmi Panduranga, May 9, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    489
    Rashmi Panduranga
    May 9, 2005
  2. GMK

    Creating a search Facility

    GMK, Mar 1, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    492
    =?Utf-8?B?Q293Ym95IChHcmVnb3J5IEEuIEJlYW1lcikgLSBN
    Mar 1, 2005
  3. Replies:
    2
    Views:
    6,058
    Chris Uppal
    Jun 20, 2006
  4. leroy isaac
    Replies:
    1
    Views:
    480
    James Willmore
    Oct 29, 2004
  5. Bad Dog
    Replies:
    0
    Views:
    234
    Bad Dog
    Aug 9, 2007
Loading...

Share This Page