


SYSLOG(3)           Linux Programmer's Manual           SYSLOG(3)


NNAAMMEE
       closelog,  openlog,  syslog  - send messages to the system
       logger

SSYYNNOOPPSSIISS
       ##iinncclluuddee <<ssyysslloogg..hh>>

       vvooiidd ooppeennlloogg(( cchhaarr _*_i_d_e_n_t,, iinntt _o_p_t_i_o_n,, iinntt  _f_a_c_i_l_i_t_y))

       vvooiidd ssyysslloogg(( iinntt _p_r_i_o_r_i_t_y,, cchhaarr _*_f_o_r_m_a_t,, ......))

       vvooiidd cclloosseelloogg(( vvooiidd ))


DDEESSCCRRIIPPTTIIOONN
       cclloosseelloogg(()) closes the descriptor being used  to  write  to
       the system logger.  The use of cclloosseelloogg(()) is optional.

       ooppeennlloogg(())  opens  a  connection to the system logger for a
       program.  The string pointed to by _i_d_e_n_t is added to  each
       message, and is typically set to the program name.  Values
       for _o_p_t_i_o_n and _f_a_c_i_l_i_t_y are given  in  the  next  section.
       The use of ooppeennlloogg(()) is optional; It will automatically be
       called by ssyysslloogg(()) if necessary, in which case _i_d_e_n_t  will
       default to NULL.

       ssyysslloogg(())  generates  a  log  message,  which  will be dis-
       tributed by ssyyssllooggdd(8).  _p_r_i_o_r_i_t_y is a combination of  the
       _f_a_c_i_l_i_t_y  and the _l_e_v_e_l, values for which are given in the
       next section.  The remaining arguments are a _f_o_r_m_a_t, as in
       pprriinnttff(3) and any arguments required by the _f_o_r_m_a_t, except
       that the two character %m will be replaced  by  the  error
       message  string  (_s_t_r_e_r_r_o_r)  corresponding  to the present
       value of _e_r_r_n_o.


PPAARRAAMMEETTEERRSS
       This section lists the parameters used to set  the  values
       of _o_p_t_i_o_n, _f_a_c_i_l_i_t_y, and _p_r_i_o_r_i_t_y.

   ooppttiioonn
       The _o_p_t_i_o_n argument to ooppeennlloogg(()) is an OR of any of these:

       LLOOGG__CCOONNSS
              write directly to system console  if  there  is  an
              error while sending to system logger

       LLOOGG__NNDDEELLAAYY
              open the connection immediately (normally, the con-
              nection is opened when the first message is logged)

       LLOOGG__PPEERRRROORR
              print to stderr as well




Linux                      15 Feb 1994                          1





SYSLOG(3)           Linux Programmer's Manual           SYSLOG(3)


       LLOOGG__PPIIDD
              include PID with each message

   ffaacciilliittyy
       The _f_a_c_i_l_i_t_y argument is used to specify what type of pro-
       gram is logging the message.  This lets the  configuration
       file  specify that messages from different facilities will
       be handled differently.

       LLOOGG__AAUUTTHH
              security/authorization  messages  (DEPRECATED   Use
              LLOOGG__AAUUTTHHPPRRIIVV instead)

       LLOOGG__AAUUTTHHPPRRIIVV
              security/authorization messages (private)

       LLOOGG__CCRROONN
              clock daemon (ccrroonn and aatt)

       LLOOGG__DDAAEEMMOONN
              other system daemons

       LLOOGG__KKEERRNN
              kernel messages

       LLOOGG__LLOOCCAALL00 through LLOOGG__LLOOCCAALL77
              reserved for local use

       LLOOGG__LLPPRR
              line printer subsystem

       LLOOGG__MMAAIILL
              mail subsystem

       LLOOGG__NNEEWWSS
              USENET news subsystem

       LLOOGG__SSYYSSLLOOGG
              messages generated internally by ssyyssllooggdd

       LLOOGG__UUSSEERR(default)
              generic user-level messages

       LLOOGG__UUUUCCPP
              UUCP subsystem


   lleevveell
       This determines the importance of the message.  The levels
       are, in order of decreasing importance:

       LLOOGG__EEMMEERRGG
              system is unusable




Linux                      15 Feb 1994                          2





SYSLOG(3)           Linux Programmer's Manual           SYSLOG(3)


       LLOOGG__AALLEERRTT
              action must be taken immediately

       LLOOGG__CCRRIITT
              critical conditions

       LLOOGG__EERRRR
              error conditions

       LLOOGG__WWAARRNNIINNGG
              warning conditions

       LLOOGG__NNOOTTIICCEE
              normal, but significant, condition

       LLOOGG__IINNFFOO
              informational message

       LLOOGG__DDEEBBUUGG
              debug-level message



HHIISSTTOORRYY
       A ssyysslloogg function call appeared in BSD 4.2.

SSEEEE AALLSSOO
       llooggggeerr(1), ssyysslloogg..ccoonnff(5), ssyyssllooggdd(8)





























Linux                      15 Feb 1994                          3


