]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[mod_logfile] add logfile open error log and fixes a missing \n
authorSeven Du <dujinfang@gmail.com>
Fri, 11 Aug 2023 11:21:59 +0000 (19:21 +0800)
committerGitHub <noreply@github.com>
Fri, 11 Aug 2023 11:21:59 +0000 (14:21 +0300)
src/mod/loggers/mod_logfile/mod_logfile.c

index 877403c5b64ca42a706cfe8dc79a6cc1baa9e871..e79e23129af8c5473de5b41efb6ae2ce091a14ce 100644 (file)
@@ -98,6 +98,8 @@ static switch_status_t mod_logfile_openlogfile(logfile_profile_t *profile, switc
 
        stat = switch_file_open(&afd, profile->logfile, flags, SWITCH_FPROT_OS_DEFAULT, module_pool);
        if (stat != SWITCH_STATUS_SUCCESS) {
+               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "logfile %s open error, status=%d\n", profile->logfile, stat);
+
                return SWITCH_STATUS_FALSE;
        }
 
@@ -459,7 +461,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_logfile_load)
                if ((profiles = switch_xml_child(cfg, "profiles"))) {
                        for (xprofile = switch_xml_child(profiles, "profile"); xprofile; xprofile = xprofile->next) {
                                if (load_profile(xprofile) != SWITCH_STATUS_SUCCESS) {
-                                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "error loading profile.");
+                                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "error loading profile.\n");
                                }
                        }
                }