1 .\" Copyright (c) 1997 Kungliga Tekniska Högskolan
2 .\" $Id: krb5_openlog.3,v 1.7 2002/08/28 15:30:55 joda Exp $
10 .Nm krb5_addlog_dest ,
11 .Nm krb5_addlog_func ,
16 .Nd Heimdal logging functions
18 Kerberos 5 Library (libkrb5, -lkrb5)
22 .Fn "\*(lp*krb5_log_log_func_t\*(rp" "const char *time" "const char *message" "void *data"
24 .Fn "\*(lp*krb5_log_close_func_t\*(rp" "void *data"
26 .Fn krb5_addlog_dest "krb5_context context" "krb5_log_facility *facility" "const char *destination"
28 .Fn krb5_addlog_func "krb5_context context" "krb5_log_facility *facility" "int min" "int max" "krb5_log_log_func_t log" "krb5_log_close_func_t close" "void *data"
30 .Fn krb5_closelog "krb5_context context" "krb5_log_facility *facility"
32 .Fn krb5_initlog "krb5_context context" "const char *program" "krb5_log_facility **facility"
34 .Fn krb5_log "krb5_context context" "krb5_log_facility *facility" "int level" "const char *format" "..."
36 .Fn krb5_log_msg "krb5_context context" "krb5_log_facility *facility" "char **reply" "int level" "const char *format" "..."
38 .Fn krb5_openlog "krb5_context context" "const char *program" "krb5_log_facility **facility"
40 .Fn krb5_vlog "krb5_context context" "krb5_log_facility *facility" "int level" "const char *format" "va_list arglist"
42 .Fn krb5_vlog_msg "krb5_context context" "krb5_log_facility *facility" "char **reply" "int level" "const char *format" "va_list arglist"
44 These functions logs messages to one or more destinations.
48 function creates a logging
50 that is used to log messages. A facility consists of one or more
51 destinations (which can be files or syslog or some other device). The
53 parameter should be the generic name of the program that is doing the
54 logging. This name is used to lookup which destinations to use. This
55 information is contained in the
59 configuration file. If no entry is found for
63 is used, or if that is missing too,
65 will be used as destination.
67 To close a logging facility, use the
71 To log a message to a facility use one of the functions
77 The functions ending in
81 a pointer to the message that just got logged. This string is allocated,
82 and should be freed with
88 style format string (but see the BUGS section).
90 If you want better control of where things gets logged, you can instead of using
94 which just initializes a facility, but doesn't define any actual logging
95 destinations. You can then add destinations with the
99 functions. The first of these takes a string specifying a logging
100 destination, and adds this to the facility. If you want to do some
101 non-standard logging you can use the
103 function, which takes a function to use when logging.
106 function is called for each message with
108 being a string specifying the current time, and
112 is called when the facility is closed. You can pass application specific data in the
118 parameter are the same as in a destination (defined below). To specify a
119 max of infinity, pass -1.
126 for each destination found.
128 The defined destinations (as specified in
131 .Bl -tag -width "xxx" -offset indent
133 This logs to the program's stderr.
134 .It Li FILE: Ns Pa /file
135 .It Li FILE= Ns Pa /file
136 Log to the specified file. The form using a colon appends to the file, the
137 form with an equal truncates the file. The truncating form keeps the file
138 open, while the appending form closes it after each log message (which
139 makes it possible to rotate logs). The truncating form is mainly for
140 compatibility with the MIT libkrb5.
141 .It Li DEVICE= Ns Pa /device
142 This logs to the specified device, at present this is the same as
145 Log to the console, this is the same as
146 .Li DEVICE=/dev/console .
147 .It Li SYSLOG Ns Op :priority Ns Op :facility
148 Send messages to the syslog system, using priority, and facility. To
149 get the name for one of these, you take the name of the macro passed
152 and remove the leading
157 The default values (as well as the values used for unrecognised
164 for a list of priorities and facilities.
167 Each destination may optionally be prepended with a range of logging
174 is within this range (inclusive) the message gets logged to this
175 destination, otherwise not. Either of the min and max valued may be
176 omitted, in this case min is assumed to be zero, and max is assumed to be
177 infinity. If you don't include a dash, both min and max gets set to the
178 specified value. If no range is specified, all messages gets logged.
180 .Bd -literal -offset indent
182 kdc = 0/FILE:/var/log/kdc.log
183 kdc = 1-/SYSLOG:INFO:USER
187 This will log all messages from the
189 program with level 0 to
190 .Pa /var/log/kdc.log ,
191 other messages will be logged to syslog with priority
195 All other programs will log all messages to their stderr.
199 to format the message. If your operating system does not have a working
201 a replacement will be used. At present this replacement does not handle
202 some correct conversion specifications (like floating point numbers). Until
203 this is fixed, the use of these conversions should be avoided.
205 If logging is done to the syslog facility, these functions might not be
206 thread-safe, depending on the implementation of