final C code logging patchups
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 30 Nov 2005 15:11:17 +0000 (15:11 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 30 Nov 2005 15:11:17 +0000 (15:11 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@2128 dcc99617-32d9-48b4-a31d-7c20da2025e4

OpenSRF/src/libstack/osrf_system.c
OpenSRF/src/utils/log.c

index acb7c34..ac698f7 100644 (file)
@@ -155,6 +155,7 @@ int osrf_system_bootstrap_client_resc( char* config_file, char* contextnode, cha
        char* port                      = osrfConfigGetValue( NULL, "/port" );
        char* unixpath          = osrfConfigGetValue( NULL, "/unixpath" );
        char* facility          = osrfConfigGetValue( NULL, "/syslog" );
+       char* actlog            = osrfConfigGetValue( NULL, "/actlog" );
 
        char* domain = strdup(osrfStringArrayGetString( arr, 0 )); /* just the first for now */
        osrfStringArrayFree(arr);
@@ -170,6 +171,7 @@ int osrf_system_bootstrap_client_resc( char* config_file, char* contextnode, cha
        if(!strcmp(log_file, "syslog")) {
                osrfLogInit( OSRF_LOG_TYPE_SYSLOG, contextnode, llevel );
                osrfLogSetSyslogFacility(osrfLogFacilityToInt(facility));
+               if(actlog) osrfLogSetSyslogActFacility(osrfLogFacilityToInt(actlog));
 
        } else {
                osrfLogInit( OSRF_LOG_TYPE_FILE, contextnode, llevel );
@@ -197,6 +199,7 @@ int osrf_system_bootstrap_client_resc( char* config_file, char* contextnode, cha
                __osrfGlobalTransportClient = client;
        }
 
+       free(actlog);
        free(facility);
        free(log_level);
        free(log_file);
index 194a8b3..eb6a100 100644 (file)
@@ -161,14 +161,14 @@ int osrfLogFacilityToInt( char* facility ) {
        if(!facility) return LOG_LOCAL0;
        if(strlen(facility) < 6) return LOG_LOCAL0;
        switch( facility[5] ) {
-               case 0: return LOG_LOCAL0;
-               case 1: return LOG_LOCAL1;
-               case 2: return LOG_LOCAL2;
-               case 3: return LOG_LOCAL3;
-               case 4: return LOG_LOCAL4;
-               case 5: return LOG_LOCAL5;
-               case 6: return LOG_LOCAL6;
-               case 7: return LOG_LOCAL7;
+               case '0': return LOG_LOCAL0;
+               case '1': return LOG_LOCAL1;
+               case '2': return LOG_LOCAL2;
+               case '3': return LOG_LOCAL3;
+               case '4': return LOG_LOCAL4;
+               case '5': return LOG_LOCAL5;
+               case '6': return LOG_LOCAL6;
+               case '7': return LOG_LOCAL7;
        }
        return LOG_LOCAL0;
 }