to each Catalyst apps main package fixed the issue but isn't nice as it isn't part of the log config but the code.
I'm proposing a new ::Appender::Screen config option autoflush which enables autoflush for the configured output STDOUT or STDERR, depending on the existing stderr config option.
If you agree I'm willing to write a pull-request for it.
While containerizing my Catalyst applications, which use Log::Log4perl::Catalyst and ::Appender::Screen, I've faced the issue of massively delayed log messages. After trying multiple solutions (non-blocking docker logging, Log::Log4perl::Catalyst->new(..., { autoflush => 1 });) I came across https://perldoc.perl.org/perlfaq5#How-do-I-flush%2Funbuffer-an-output-filehandle%3F-Why-must-I-do-this%3F.
Adding
to each Catalyst apps main package fixed the issue but isn't nice as it isn't part of the log config but the code.
I'm proposing a new ::Appender::Screen config option
autoflush
which enables autoflush for the configured output STDOUT or STDERR, depending on the existingstderr
config option.If you agree I'm willing to write a pull-request for it.