From 53d694eb59b4f1cc1aa1e7d572a4fac414ded2d1 Mon Sep 17 00:00:00 2001 From: Marc Olivier Chouinard Date: Thu, 15 Dec 2011 17:09:59 -0500 Subject: [PATCH] FS-3572 --resolve --- src/mod/loggers/mod_logfile/mod_logfile.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/mod/loggers/mod_logfile/mod_logfile.c b/src/mod/loggers/mod_logfile/mod_logfile.c index 3ada0d252e..63de81b24d 100644 --- a/src/mod/loggers/mod_logfile/mod_logfile.c +++ b/src/mod/loggers/mod_logfile/mod_logfile.c @@ -231,8 +231,18 @@ static switch_status_t process_node(const switch_log_node_t *node, switch_log_le if (ok) { if (profile->log_uuid && !zstr(node->userdata)) { char buf[2048]; - switch_snprintf(buf, sizeof(buf), "%s %s", node->userdata, node->data); - mod_logfile_raw_write(profile, buf); + char *dup = strdup(node->data); + char *lines[100]; + int argc, i; + + argc = switch_split(dup, '\n', lines); + for (i = 0; i < argc; i++) { + switch_snprintf(buf, sizeof(buf), "%s %s\n", node->userdata, lines[i]); + mod_logfile_raw_write(profile, buf); + } + + free(dup); + } else { mod_logfile_raw_write(profile, node->data); }