diff --git a/base/daemon/BaseDaemon.cpp b/base/daemon/BaseDaemon.cpp index c7012a3ba04..a7edc425b34 100644 --- a/base/daemon/BaseDaemon.cpp +++ b/base/daemon/BaseDaemon.cpp @@ -547,6 +547,9 @@ void BaseDaemon::initialize(Application & self) std::string stderr_path = config().getString("logger.stderr", log_path + "/stderr.log"); if (!freopen(stderr_path.c_str(), "a+", stderr)) throw Poco::OpenFileException("Cannot attach stderr to " + stderr_path); + + /// Disable buffering for stderr + setbuf(stderr, nullptr); } if ((!log_path.empty() && is_daemon) || config().has("logger.stdout"))