Skip to content

Commit 15b042b

Browse files
Set stdout to line-buffered for container environments
Without a TTY (e.g. in Docker), stdout defaults to fully buffered, delaying log output. setvbuf at startup ensures each line flushes immediately.
1 parent a21f937 commit 15b042b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/dionaea.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,8 @@ int logger_load(struct options *opt)
522522

523523
int main (int argc, char *argv[])
524524
{
525+
setvbuf(stdout, NULL, _IOLBF, 0);
526+
525527
GError *error = NULL;
526528
struct version v;
527529
g_log_set_default_handler(logger_stdout_log, NULL);

0 commit comments

Comments
 (0)