]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
LOGGER-3
authorBrian West <brian@freeswitch.org>
Thu, 15 Oct 2009 03:49:26 +0000 (03:49 +0000)
committerBrian West <brian@freeswitch.org>
Thu, 15 Oct 2009 03:49:26 +0000 (03:49 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15162 d0543943-73ff-0310-b7d9-9358b9ac24b2

conf/autoload_configs/syslog.conf.xml
src/mod/loggers/mod_syslog/mod_syslog.c

index 1070ba54b3c0cc9d1f1f515925a6d874ec143507..88ff4b49b35e03775e7d473a26790ce38ef2f7ae 100644 (file)
@@ -9,6 +9,7 @@
   <!-- info    - informational message  -->
   <!-- debug   - debug-level message -->
   <settings>
+    <param name="facility" value="user"/>
     <param name="ident" value="freeswitch"/>
     <param name="loglevel" value="warning"/>
   </settings>
index 2827a40dba46c1ed5b06dd76b9c1f25dfa19c341..2cccebd975eb0c5cf11e23b11b92221114fbd71e 100644 (file)
@@ -49,10 +49,12 @@ static switch_log_level_t log_level;
 static struct {
        char *ident;
        char *format;
+       char *facility;
 } globals;
 
 SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_ident, globals.ident);
 SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_format, globals.format);
+SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_facility, globals.facility);
 
 static switch_loadable_module_interface_t console_module_interface = {
        /*.module_name */ modname,
@@ -126,6 +128,8 @@ static switch_status_t load_config(void)
                                        set_global_ident(val);
                                } else if (!strcmp(var, "format")) {
                                        set_global_format(val);
+                               } else if (!strcmp(var, "facility")) {
+                                       set_global_facility(val);
                 } else if (!strcasecmp(var, "loglevel") && !switch_strlen_zero(val)) {
                     log_level = switch_log_str2level(val);
                     if (log_level == SWITCH_LOG_INVALID) {
@@ -144,7 +148,9 @@ static switch_status_t load_config(void)
        if (switch_strlen_zero(globals.format)) {
                set_global_format(DEFAULT_FORMAT);
        }
-
+    if (switch_strlen_zero(globals.facility)) {
+               set_global_facility(DEFAULT_FACILITY);
+    }
        return 0;
 }
 
@@ -173,6 +179,7 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_syslog_shutdown)
 
        switch_safe_free(globals.ident);
        switch_safe_free(globals.format);
+       switch_safe_free(globals.facility);
 
        switch_log_unbind_logger(mod_syslog_logger);