home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / perl5 / Sys::Syslog.z / Sys::Syslog
Encoding:
Text File  |  2002-10-03  |  4.0 KB  |  133 lines

  1.  
  2.  
  3.  
  4. SSSSyyyyssss::::::::SSSSyyyysssslllloooogggg((((3333))))                                                  SSSSyyyyssss::::::::SSSSyyyysssslllloooogggg((((3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      Sys::Syslog, openlog, closelog, setlogmask, syslog - Perl interface to
  10.      the UNIX _s_y_s_l_o_g(3) calls
  11.  
  12. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.          use Sys::Syslog;                          # all except setlogsock, or:
  14.          use Sys::Syslog qw(:DEFAULT setlogsock);  # default set, plus setlogsock
  15.  
  16.          setlogsock $sock_type;
  17.          openlog $ident, $logopt, $facility;
  18.          syslog $priority, $format, @args;
  19.          $oldmask = setlogmask $mask_priority;
  20.          closelog;
  21.  
  22.  
  23. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  24.      Sys::Syslog is an interface to the UNIX syslog(3) program.  Call syslog()
  25.      with a string priority and a list of printf() args just like syslog(3).
  26.  
  27.      Syslog provides the functions:
  28.  
  29.      openlog $ident, $logopt, $facility
  30.           $_i_d_e_n_t is prepended to every message.  $_l_o_g_o_p_t contains zero or more
  31.           of the words _p_i_d, _n_d_e_l_a_y, _c_o_n_s, _n_o_w_a_i_t.  $_f_a_c_i_l_i_t_y specifies the
  32.           part of the system
  33.  
  34.      syslog $priority, $format, @args
  35.           If $_p_r_i_o_r_i_t_y permits, logs ($_f_o_r_m_a_t, @_a_r_g_s) printed as by
  36.           printf(3V), with the addition that %_m is replaced with "$!" (the
  37.           latest error message).
  38.  
  39.      setlogmask $mask_priority
  40.           Sets log mask $_m_a_s_k__p_r_i_o_r_i_t_y and returns the old mask.
  41.  
  42.      setlogsock $sock_type (added in 5.004_02)
  43.           Sets the socket type to be used for the next call to openlog() or
  44.           syslog() and returns TRUE on success, undef on failure.
  45.  
  46.           A value of 'unix' will connect to the UNIX domain socket returned by
  47.           _PATH_LOG in _s_y_s_l_o_g._p_h.  A value of 'inet' will connect to an INET
  48.           socket returned by _g_e_t_s_e_r_v_b_y_n_a_m_e().  Any other value croaks.
  49.  
  50.           The default is for the INET socket to be used.
  51.  
  52.      closelog
  53.           Closes the log file.
  54.  
  55.      Note that openlog now takes three arguments, just like openlog(3).
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. SSSSyyyyssss::::::::SSSSyyyysssslllloooogggg((((3333))))                                                  SSSSyyyyssss::::::::SSSSyyyysssslllloooogggg((((3333))))
  71.  
  72.  
  73.  
  74. EXAMPLES
  75.          openlog($program, 'cons,pid', 'user');
  76.          syslog('info', 'this is another test');
  77.          syslog('mail|warning', 'this is a better test: %d', time);
  78.          closelog();
  79.  
  80.          syslog('debug', 'this is the last test');
  81.  
  82.          setlogsock('unix');
  83.          openlog("$program $$", 'ndelay', 'user');
  84.          syslog('notice', 'fooprogram: this is really done');
  85.  
  86.          setlogsock('inet');
  87.          $! = 55;
  88.          syslog('info', 'problem was %m'); # %m == $! in syslog(3)
  89.  
  90.  
  91. DDDDEEEEPPPPEEEENNNNDDDDEEEENNNNCCCCIIIIEEEESSSS
  92.      SSSSyyyyssss::::::::SSSSyyyysssslllloooogggg needs _s_y_s_l_o_g._p_h, which can be created with h2ph.
  93.  
  94. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  95.      the _s_y_s_l_o_g(_3) manpage
  96.  
  97. AAAAUUUUTTTTHHHHOOOORRRR
  98.      Tom Christiansen <_t_c_h_r_i_s_t@_p_e_r_l._c_o_m> and Larry Wall <_l_a_r_r_y@_w_a_l_l._o_r_g>.
  99.      UNIX domain sockets added by Sean Robinson <_r_o_b_i_n_s_o_n__s@_s_c._m_a_r_i_c_o_p_a._e_d_u>
  100.      with support from Tim Bunce <Tim.Bunce@ig.co.uk> and the perl5-porters
  101.      mailing list.
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.