Permalink
Browse files

Merge pull request #27 from pecastro/add-error-log-option

Net::Server doesn't like being passed a bare *STDERR handle.
  • Loading branch information...
miyagawa committed Jun 16, 2011
2 parents 20cd60f + e5efc74 commit 63e69e3e41e6f0775ca48336ea7ed9bbf0979c11
Showing with 6 additions and 1 deletion.
  1. +5 −0 bin/starman
  2. +1 −1 lib/Starman/Server.pm
View
@@ -171,6 +171,11 @@ Defaults to the current group id.
Specify the pid file path. Use it with C<-D|--daemonize> option,
described in C<plackup -h>.
+=item --error-log
+
+Specify the pathname of a file where the error log should be written.
+This enables you to still have access to the errors when using C<--daemonize>.
+
=back
Starman passes through other options given to L<Plack::Runner>, the
View
@@ -68,7 +68,7 @@ sub run {
proto => $proto,
serialize => 'flock',
log_level => DEBUG ? 4 : 2,
- log_file => $options->{error_log} || *STDERR,
+ ($options->{error_log} ? ( log_file => $options->{error_log} ) : () ),
min_servers => $options->{min_servers} || $workers,
min_spare_servers => $options->{min_spare_servers} || $workers - 1,
max_spare_servers => $options->{max_spare_servers} || $workers - 1,

0 comments on commit 63e69e3

Please sign in to comment.