Add 'flush_line' option to filelog section.
authorAdrian-Ken Rueegsegger <rueegsegger@swiss-it.ch>
Sun, 2 May 2010 12:37:16 +0000 (14:37 +0200)
committerMartin Willi <martin@revosec.ch>
Tue, 4 May 2010 12:47:56 +0000 (14:47 +0200)
The new boolean 'flush_line' option in the filelog section of
strongswan.conf specifies if log messages should be flushed to the given
file for each new line.

src/libcharon/daemon.c

index 11c94be..6243026 100644 (file)
@@ -254,6 +254,11 @@ static void initialize_loggers(private_daemon_t *this, bool use_stderr,
                                         filename, strerror(errno));
                                continue;
                        }
+                       if (lib->settings->get_bool(lib->settings,
+                                                       "charon.filelog.%s.flush_line", FALSE, filename))
+                       {
+                               setlinebuf(file);
+                       }
                }
                file_logger = file_logger_create(file);
                def = lib->settings->get_int(lib->settings,