Lines 29-35
Link Here
|
29 |
use strict; |
29 |
use strict; |
30 |
use warnings; |
30 |
use warnings; |
31 |
|
31 |
|
32 |
my %is_open = (); |
32 |
my %log_file = (); |
33 |
|
33 |
|
34 |
while (my $log_line = <STDIN>) { |
34 |
while (my $log_line = <STDIN>) { |
35 |
# |
35 |
# |
Lines 54-63
Link Here
|
54 |
# If the log file for this virtual host isn't opened |
54 |
# If the log file for this virtual host isn't opened |
55 |
# yet, do it now. |
55 |
# yet, do it now. |
56 |
# |
56 |
# |
57 |
if (! $is_open{$vhost}) { |
57 |
if (! $log_file{$vhost}) { |
58 |
open $vhost, ">>${vhost}.log" |
58 |
open $log_file{$vhost}, ">>${vhost}.log" |
59 |
or die ("Can't open ${vhost}.log"); |
59 |
or die ("Can't open ${vhost}.log"); |
60 |
$is_open{$vhost} = 1; |
|
|
61 |
} |
60 |
} |
62 |
# |
61 |
# |
63 |
# Strip off the first token (which may be null in the |
62 |
# Strip off the first token (which may be null in the |
Lines 65-70
Link Here
|
65 |
# record to the current log file. |
64 |
# record to the current log file. |
66 |
# |
65 |
# |
67 |
$log_line =~ s/^\S*\s+//; |
66 |
$log_line =~ s/^\S*\s+//; |
68 |
printf $vhost "%s", $log_line; |
67 |
print {$log_file{$vhost}} $log_line; |
69 |
} |
68 |
} |
70 |
exit 0; |
69 |
exit 0; |