[pubcookie-dev] Proposed changes to Logging

Bradley Schwoerer schwoerb at doit.wisc.edu
Wed Jun 21 11:00:03 PDT 2006


Attached.  I will try to always attach instead of copy and paste.

-Bradley


On 6/21/06 11:23 AM, "Nathan Dors" <dors at cac.washington.edu> wrote:

> Dang. Maybe it's me, but this one doesn't apply either:
> 
> $ patch < brads-syslog-patch.diff
> patching file pbc_logging.c
> Hunk #1 FAILED at 18.
> 1 out of 2 hunks FAILED -- saving rejects to file pbc_logging.c.rej
> 
> This is against r1.34 of pbc_logging.c in cvs.
> 
> I'll defer to our login server admin to comment on the proposed
> change.
> 
> -Nathan
> 
> 
> On Tue, 20 Jun 2006, Bradley Schwoerer wrote:
> 
>> Below is a proposed change to the priority levels of errors for syslog.
>> Currently all log entries are given the same syslog priority.  This change
>> maps the current PBC log levels to syslog priorities.  We made this change
>> to better accommodate using one syslog facility while still separating the
>> logs into separate files.
>> 
>> Example of using one syslog facility while still separating the logs
>> 
>> pubcookie/config
>> general_facility: local6
>> audit_facility: local6
>> 
>> /etc/syslog.conf
>> # Pubcookie Logs
>> local6.*;local6.!=notice                 /var/log/pubcookie/messages
>> local6.=notice                           /var/log/pubcookie/audit
>> 
>> 
>> Or, you are still able to separate the logs using current functionality with
>> a slight difference being that priority level of messages are no longer just
>> INFO.
>> 
>> 
>> Bradley Schwoerer
>> University of Wisconsin-Madison
>> DoIT Middleware
>> 
>> 
>> 
>> 
>> ---[ ds/c/pubcookie/src ]---
>> 
>> Index: ds/c/pubcookie/src/pbc_logging.c
>> diff -u ds/c/pubcookie/src/pbc_logging.c:1.2
>> ds/c/pubcookie/src/pbc_logging.c:1.3
>> --- ds/c/pubcookie/src/pbc_logging.c:1.2 Thu Nov 10 16:56:23 2005
>> +++ ds/c/pubcookie/src/pbc_logging.c Fri Jun 16 12:19:56 2006
>> @@ -18,7 +18,7 @@
>> /** @file pbc_logging.c
>>  * Logging
>>  *
>> - * $Id: pbc_logging.c,v 1.2 2005/11/10 22:56:23 miner Exp $
>> + * $Id: pbc_logging.c,v 1.3 2006/06/16 17:19:56 schwoerb Exp $
>>  */
>> 
>> 
>> @@ -132,11 +132,23 @@
>>     const char *facstr =
>>         libpbc_config_getstring (p, "general_facility", NULL);
>> 
>> -    if (logging_level == PBC_LOG_ERROR) {
>> -        pri = LOG_ERR;
>> -    } else if (logging_level == PBC_LOG_AUDIT) {
>> -        fac = PBC_LOG_AUDIT_FACILITY;
>> -        facstr = libpbc_config_getstring (p, "audit_facility", NULL);
>> +    switch(logging_level) {
>> +        case PBC_LOG_ERROR:
>> +            pri = LOG_ERR;
>> +            break;
>> +        case PBC_LOG_AUDIT:
>> +            fac = PBC_LOG_AUDIT_FACILITY;
>> +            facstr = libpbc_config_getstring (p, "audit_facility", NULL);
>> +
>> +            pri = LOG_NOTICE;
>> +            break;
>> +        case PBC_LOG_DEBUG_LOW:
>> +            pri = LOG_INFO;
>> +            break;
>> +        case PBC_LOG_DEBUG_VERBOSE:
>> +        case PBC_LOG_DEBUG_OUTPUT:
>> +        default:
>> +            pri = LOG_DEBUG;
>>     }
>> 
>>     if (facstr != NULL) {
>> 
>> 
>> ---
>> You are currently subscribed to mst-cvs-ds-pubcookie as: bschwoerer at wisc.edu
>> To unsubscribe send a blank email to leave-2846971-2267482D at lists.wisc.edu
>> 
>> ------ End of Forwarded Message
>> 
>> 
>> _______________________________________________
>> pubcookie-dev mailing list
>> pubcookie-dev at u.washington.edu
>> http://mailman1.u.washington.edu/mailman/listinfo/pubcookie-dev
>> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: brads_logging.patch
Type: application/octet-stream
Size: 1516 bytes
Desc: not available
Url : http://mailman1.u.washington.edu/pipermail/pubcookie-dev/attachments/20060621/b57b7f5c/brads_logging.obj


More information about the pubcookie-dev mailing list