Skip Menu |

This queue is for tickets about the POE-Component-Server-HTTPServer CPAN distribution.

Report information
The Basics
Id: 13364
Status: open
Priority: 0/
Queue: POE-Component-Server-HTTPServer

People
Owner: Nobody in particular
Requestors: bfaist [...] oneil.com
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: Improving logging with autoflush
Adding "autoflush" call to the log file handle would improve logging. Without this, the log file output is buffered. If the POE HTTP server is stopped before a buffer is flushed, then this logging is missed. HTTPServer.pm use FileHandle qw(autoflush); # omitted code sub create_server { my $self = shift; unless ( @{$self->handlers()} ) { $self->{_debug}->("No handlers: setting NotFoundHandler for all\n"); $self->handlers( ['/' => new_handler('NotFoundHandler')] ); } if ( defined($self->{_log_file}) ) { $self->{_debug}->("Opening log: $self->{_log_file}\n"); open( $self->{_log_fh}, ">> $self->{_log_file}" ) || warn "Could not open log file '$self->{_log_file}' ($!)\n"; autoflush $self->{_log_fh}, 1; # suggestion here } $self->{_debug}->("Creating server component\n"); return POE::Component::Server::TCP->new( Port => $self->port, ClientInput => $self->_get_dispatcher, ClientFilter => 'POE::Filter::HTTPD', ); }

Message body is not shown because it is too large.

[guest - Wed Jun 22 09:15:24 2005]: Show quoted text
> autoflush $self->{_log_fh}, 1; # suggestion here
Suggested mod checked in, will be in next release (0.9.3).