source: heimdal/trunk/lib/krb5/krb5_openlog.cat3

Last change on this file was 1, checked in by Paul Smedley, 10 years ago

Initial commit of Heimdal 1.5.3

File size: 9.8 KB
Line 
1
2KRB5_OPENLOG(3) BSD Library Functions Manual KRB5_OPENLOG(3)
3
4NNAAMMEE
5 kkrrbb55__iinniittlloogg, kkrrbb55__ooppeennlloogg, kkrrbb55__cclloosseelloogg, kkrrbb55__aaddddlloogg__ddeesstt,
6 kkrrbb55__aaddddlloogg__ffuunncc, kkrrbb55__lloogg, kkrrbb55__vvlloogg, kkrrbb55__lloogg__mmssgg, kkrrbb55__vvlloogg__mmssgg --
7 Heimdal logging functions
8
9LLIIBBRRAARRYY
10 Kerberos 5 Library (libkrb5, -lkrb5)
11
12SSYYNNOOPPSSIISS
13 ##iinncclluuddee <<kkrrbb55..hh>>
14
15 _t_y_p_e_d_e_f _v_o_i_d
16 (**kkrrbb55__lloogg__lloogg__ffuunncc__tt)(_c_o_n_s_t _c_h_a_r _*_t_i_m_e, _c_o_n_s_t _c_h_a_r _*_m_e_s_s_a_g_e,
17 _v_o_i_d _*_d_a_t_a);
18
19 _t_y_p_e_d_e_f _v_o_i_d
20 (**kkrrbb55__lloogg__cclloossee__ffuunncc__tt)(_v_o_i_d _*_d_a_t_a);
21
22 _k_r_b_5___e_r_r_o_r___c_o_d_e
23 kkrrbb55__aaddddlloogg__ddeesstt(_k_r_b_5___c_o_n_t_e_x_t _c_o_n_t_e_x_t, _k_r_b_5___l_o_g___f_a_c_i_l_i_t_y _*_f_a_c_i_l_i_t_y,
24 _c_o_n_s_t _c_h_a_r _*_d_e_s_t_i_n_a_t_i_o_n);
25
26 _k_r_b_5___e_r_r_o_r___c_o_d_e
27 kkrrbb55__aaddddlloogg__ffuunncc(_k_r_b_5___c_o_n_t_e_x_t _c_o_n_t_e_x_t, _k_r_b_5___l_o_g___f_a_c_i_l_i_t_y _*_f_a_c_i_l_i_t_y,
28 _i_n_t _m_i_n, _i_n_t _m_a_x, _k_r_b_5___l_o_g___l_o_g___f_u_n_c___t _l_o_g,
29 _k_r_b_5___l_o_g___c_l_o_s_e___f_u_n_c___t _c_l_o_s_e, _v_o_i_d _*_d_a_t_a);
30
31 _k_r_b_5___e_r_r_o_r___c_o_d_e
32 kkrrbb55__cclloosseelloogg(_k_r_b_5___c_o_n_t_e_x_t _c_o_n_t_e_x_t, _k_r_b_5___l_o_g___f_a_c_i_l_i_t_y _*_f_a_c_i_l_i_t_y);
33
34 _k_r_b_5___e_r_r_o_r___c_o_d_e
35 kkrrbb55__iinniittlloogg(_k_r_b_5___c_o_n_t_e_x_t _c_o_n_t_e_x_t, _c_o_n_s_t _c_h_a_r _*_p_r_o_g_r_a_m,
36 _k_r_b_5___l_o_g___f_a_c_i_l_i_t_y _*_*_f_a_c_i_l_i_t_y);
37
38 _k_r_b_5___e_r_r_o_r___c_o_d_e
39 kkrrbb55__lloogg(_k_r_b_5___c_o_n_t_e_x_t _c_o_n_t_e_x_t, _k_r_b_5___l_o_g___f_a_c_i_l_i_t_y _*_f_a_c_i_l_i_t_y, _i_n_t _l_e_v_e_l,
40 _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.);
41
42 _k_r_b_5___e_r_r_o_r___c_o_d_e
43 kkrrbb55__lloogg__mmssgg(_k_r_b_5___c_o_n_t_e_x_t _c_o_n_t_e_x_t, _k_r_b_5___l_o_g___f_a_c_i_l_i_t_y _*_f_a_c_i_l_i_t_y,
44 _c_h_a_r _*_*_r_e_p_l_y, _i_n_t _l_e_v_e_l, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _._._.);
45
46 _k_r_b_5___e_r_r_o_r___c_o_d_e
47 kkrrbb55__ooppeennlloogg(_k_r_b_5___c_o_n_t_e_x_t _c_o_n_t_e_x_t, _c_o_n_s_t _c_h_a_r _*_p_r_o_g_r_a_m,
48 _k_r_b_5___l_o_g___f_a_c_i_l_i_t_y _*_*_f_a_c_i_l_i_t_y);
49
50 _k_r_b_5___e_r_r_o_r___c_o_d_e
51 kkrrbb55__vvlloogg(_k_r_b_5___c_o_n_t_e_x_t _c_o_n_t_e_x_t, _k_r_b_5___l_o_g___f_a_c_i_l_i_t_y _*_f_a_c_i_l_i_t_y, _i_n_t _l_e_v_e_l,
52 _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_r_g_l_i_s_t);
53
54 _k_r_b_5___e_r_r_o_r___c_o_d_e
55 kkrrbb55__vvlloogg__mmssgg(_k_r_b_5___c_o_n_t_e_x_t _c_o_n_t_e_x_t, _k_r_b_5___l_o_g___f_a_c_i_l_i_t_y _*_f_a_c_i_l_i_t_y,
56 _c_h_a_r _*_*_r_e_p_l_y, _i_n_t _l_e_v_e_l, _c_o_n_s_t _c_h_a_r _*_f_o_r_m_a_t, _v_a___l_i_s_t _a_r_g_l_i_s_t);
57
58DDEESSCCRRIIPPTTIIOONN
59 These functions logs messages to one or more destinations.
60
61 The kkrrbb55__ooppeennlloogg() function creates a logging _f_a_c_i_l_i_t_y, that is used to
62 log messages. A facility consists of one or more destinations (which can
63 be files or syslog or some other device). The _p_r_o_g_r_a_m parameter should be
64 the generic name of the program that is doing the logging. This name is
65 used to lookup which destinations to use. This information is contained
66 in the logging section of the _k_r_b_5_._c_o_n_f configuration file. If no entry
67 is found for _p_r_o_g_r_a_m, the entry for default is used, or if that is miss-
68 ing too, SYSLOG will be used as destination.
69
70 To close a logging facility, use the kkrrbb55__cclloosseelloogg() function.
71
72 To log a message to a facility use one of the functions kkrrbb55__lloogg(),
73 kkrrbb55__lloogg__mmssgg(), kkrrbb55__vvlloogg(), or kkrrbb55__vvlloogg__mmssgg(). The functions ending in
74 _msg return in _r_e_p_l_y a pointer to the message that just got logged. This
75 string is allocated, and should be freed with ffrreeee(). The _f_o_r_m_a_t is a
76 standard pprriinnttff() style format string (but see the BUGS section).
77
78 If you want better control of where things gets logged, you can instead
79 of using kkrrbb55__ooppeennlloogg() call kkrrbb55__iinniittlloogg(), which just initializes a
80 facility, but doesn't define any actual logging destinations. You can
81 then add destinations with the kkrrbb55__aaddddlloogg__ddeesstt() and kkrrbb55__aaddddlloogg__ffuunncc()
82 functions. The first of these takes a string specifying a logging desti-
83 nation, and adds this to the facility. If you want to do some non-stan-
84 dard logging you can use the kkrrbb55__aaddddlloogg__ffuunncc() function, which takes a
85 function to use when logging. The _l_o_g function is called for each mes-
86 sage with _t_i_m_e being a string specifying the current time, and _m_e_s_s_a_g_e
87 the message to log. _c_l_o_s_e is called when the facility is closed. You can
88 pass application specific data in the _d_a_t_a parameter. The _m_i_n and _m_a_x
89 parameter are the same as in a destination (defined below). To specify a
90 max of infinity, pass -1.
91
92 kkrrbb55__ooppeennlloogg() calls kkrrbb55__iinniittlloogg() and then calls kkrrbb55__aaddddlloogg__ddeesstt() for
93 each destination found.
94
95 DDeessttiinnaattiioonnss
96 The defined destinations (as specified in _k_r_b_5_._c_o_n_f) follows:
97
98 STDERR
99 This logs to the program's stderr.
100
101 FILE:_/_f_i_l_e
102
103 FILE=_/_f_i_l_e
104 Log to the specified file. The form using a colon appends to
105 the file, the form with an equal truncates the file. The trun-
106 cating form keeps the file open, while the appending form
107 closes it after each log message (which makes it possible to
108 rotate logs). The truncating form is mainly for compatibility
109 with the MIT libkrb5.
110
111 DEVICE=_/_d_e_v_i_c_e
112 This logs to the specified device, at present this is the same
113 as FILE:/device.
114
115 CONSOLE
116 Log to the console, this is the same as DEVICE=/dev/console.
117
118 SYSLOG[:priority[:facility]]
119 Send messages to the syslog system, using priority, and facil-
120 ity. To get the name for one of these, you take the name of
121 the macro passed to syslog(3), and remove the leading LOG_
122 (LOG_NOTICE becomes NOTICE). The default values (as well as
123 the values used for unrecognised values), are ERR, and AUTH,
124 respectively. See syslog(3) for a list of priorities and
125 facilities.
126
127 Each destination may optionally be prepended with a range of logging lev-
128 els, specified as min-max/. If the _l_e_v_e_l parameter to kkrrbb55__lloogg() is
129 within this range (inclusive) the message gets logged to this destina-
130 tion, otherwise not. Either of the min and max valued may be omitted, in
131 this case min is assumed to be zero, and max is assumed to be infinity.
132 If you don't include a dash, both min and max gets set to the specified
133 value. If no range is specified, all messages gets logged.
134
135EEXXAAMMPPLLEESS
136 [logging]
137 kdc = 0/FILE:/var/log/kdc.log
138 kdc = 1-/SYSLOG:INFO:USER
139 default = STDERR
140
141 This will log all messages from the kkddcc program with level 0 to
142 _/_v_a_r_/_l_o_g_/_k_d_c_._l_o_g, other messages will be logged to syslog with priority
143 LOG_INFO, and facility LOG_USER. All other programs will log all mes-
144 sages to their stderr.
145
146SSEEEE AALLSSOO
147 syslog(3), krb5.conf(5)
148
149BBUUGGSS
150 These functions use aasspprriinnttff() to format the message. If your operating
151 system does not have a working aasspprriinnttff(), a replacement will be used. At
152 present this replacement does not handle some correct conversion specifi-
153 cations (like floating point numbers). Until this is fixed, the use of
154 these conversions should be avoided.
155
156 If logging is done to the syslog facility, these functions might not be
157 thread-safe, depending on the implementation of ooppeennlloogg(), and ssyysslloogg().
158
159HEIMDAL August 6, 1997 HEIMDAL
Note: See TracBrowser for help on using the repository browser.