MT#64098 enable logger autoflush

* Preamble: disabled autoflush caused logs to be written only
  when a request is finished, and what is worse, all of them
  with exact same time. As logging $c->log->* happens via syslog
  and rsyslog already uses buffering for that, there is no reason
  to cause such additional buffering by the Perl logger
  (which is Log4perl in this case). On top of it, it's already
  the default option for Log4Perl and was only inactive in the Panel app.
* enable autoflush during Log4Perl init in the Panel app.

Change-Id: I7cdcf7de30489d84fd8a9af88cb40669113ddbc1
(cherry picked from commit bb6b737c26)
(cherry picked from commit 158b6a46ca)
mr12.5.1
Kirill Solomko 4 months ago
parent 60a81b50ee
commit 1cc676b7cb

@ -331,7 +331,8 @@ __PACKAGE__->config(
);
__PACKAGE__->config( default_view => 'HTML' );
__PACKAGE__->log(Log::Log4perl::Catalyst->new($logger_config_file));
__PACKAGE__->log(Log::Log4perl::Catalyst->new($logger_config_file, autoflush => 1));
# autoflush => 1: since we are not writing directly to the log file but to syslog instead, let syslog/rsyslog take care of the buffering part, otherwise $c->log->* invokations get buffered and delayed until a request if fully completed and response is sent, on top of it all logs such dumped buffer to syslog will be logged with exact same time, which is not correct. As well as autoflush is enabled by default in Log4Perl.
# configure Data::HAL depending on our config
{

Loading…
Cancel
Save