diff --git a/daemon/log.c b/daemon/log.c index 0dec25c47..e3cc34c73 100644 --- a/daemon/log.c +++ b/daemon/log.c @@ -16,10 +16,7 @@ volatile gint log_level = LOG_INFO; volatile gint log_level = LOG_DEBUG; #endif -#ifndef MAX_LOG_LINE_LENGTH -#define MAX_LOG_LINE_LENGTH 500 -#endif - +unsigned int max_log_line_length = 500; write_log_t write_log = (write_log_t) syslog; const _fac_code_t _facilitynames[] = @@ -157,10 +154,10 @@ void ilog(int prio, const char *fmt, ...) { piece = msg; - while (ret > MAX_LOG_LINE_LENGTH) { - write_log(xprio, "%s%s%.*s ...", prefix, infix, MAX_LOG_LINE_LENGTH, piece); - ret -= MAX_LOG_LINE_LENGTH; - piece += MAX_LOG_LINE_LENGTH; + while (max_log_line_length && ret > max_log_line_length) { + write_log(xprio, "%s%s%.*s ...", prefix, infix, max_log_line_length, piece); + ret -= max_log_line_length; + piece += max_log_line_length; infix = "... "; } diff --git a/daemon/log.h b/daemon/log.h index 23170f4dc..d837a4b60 100644 --- a/daemon/log.h +++ b/daemon/log.h @@ -38,6 +38,7 @@ void log_to_stderr(int facility_priority, char *format, ...) __attribute__ ((for extern struct log_info __thread log_info; extern volatile gint log_level; +extern unsigned int max_log_line_length; diff --git a/daemon/main.c b/daemon/main.c index 56d85f0eb..8bf876f44 100644 --- a/daemon/main.c +++ b/daemon/main.c @@ -404,6 +404,7 @@ static void options(int *argc, char ***argv) { if (_log_stderr) { write_log = log_to_stderr; + max_log_line_length = 0; } }