Define log levels in docs and change default to 0-3.

We define the meaning of the various log levels in the man page
for krb5_openlog(3).  If logging configured and levels are not
specified, we change the default levels to 0-3 which should exclude
debugging messages which are generally only desired in exceptional
circumstances.

We also go through the KDC and adjust the levels to be appropriate.
This commit is contained in:
Roland C. Dowdeswell
2019-10-15 16:55:56 +01:00
committed by Roland C. Dowdeswell
parent aa5c525e71
commit c7d4682aed
11 changed files with 266 additions and 244 deletions

View File

@@ -203,9 +203,29 @@ parameter to
.Fn krb5_log
is within this range (inclusive) the message gets logged to this
destination, otherwise not. Either of the min and max valued may be
omitted, in this case min is assumed to be zero, and max is assumed to be
infinity. If you don't include a dash, both min and max gets set to the
specified value. If no range is specified, all messages gets logged.
omitted, in this case min is assumed to be 0, and max is assumed to
be 3.
If you don't include a dash, both min and max get set to the
specified value.
.Ss Levels
Each log message has a level as follows:
.Bl -tag -width "xxx" -offset indent
.It 0
Critical conditions.
This is a condition that should be corrected immediately, such as a
corrupted Kerberos database.
.It 1
Errors.
These are errors that occur in the normal processing of requests.
.It 2
Warning messages.
On the KDC, this includes malformed requests and requests that
are out of policy.
.It 3
Informational messages.
.It 4-9
Debugging messages with increasing obscurity as the level rises.
.El
.Sh EXAMPLES
.Bd -literal -offset indent
[logging]

View File

@@ -268,7 +268,7 @@ KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL
krb5_addlog_dest(krb5_context context, krb5_log_facility *f, const char *orig)
{
krb5_error_code ret = 0;
int min = 0, max = -1, n;
int min = 0, max = 3, n;
char c;
const char *p = orig;
#ifdef _WIN32
@@ -285,6 +285,8 @@ krb5_addlog_dest(krb5_context context, krb5_log_facility *f, const char *orig)
max = min;
}
}
if (c == '-')
max = -1;
}
if(n){
#ifdef _WIN32