[strongSwan-dev] [PATCH] Flush messages to file after logging.

Martin Willi martin at strongswan.org
Thu Apr 29 09:24:37 CEST 2010


Hi,

> When configuring strongSwan to use a file logger the log output
> to that file is only written when charon is shutdown or the file
> buffer is full. This change flushes the log messages on each log
> call.

While it makes sense to flush each line in most setups, this will slow
down gateways with very high throughput significantly. I think we should
have a logger option to configure the flushing behavior.

We could add a "flush_line" option in the logger section (and we would
have to fix that "dots interpreted as section delimiter"-bug in the
logger configuration).

What about configuring the flush behavior with setlinebuf() instead of
calling flush() after each line? We could do this directly in daemon.c.

Regards
Martin





More information about the Dev mailing list