- if (open my $log,'>>',"$logdir/sex.log") {
- flock $log,LOCK_EX;
- seek $log,0,SEEK_END;
- printf {$log} "%s [%s_%s] %s (%s) %s\n",
- isodate(time),$$,$ENV{REQUESTCOUNT},$user,$fra,"@_";
- close $log;
+ my $msg = "@_";
+
+ $msg =~ s/\n/ /g;
+ $msg =~ s/\s+$//;
+ $msg = sprintf "%s [%s_%s] %s (%s) %s\n",
+ isodate(time),$$,$ENV{REQUESTCOUNT},$user,$fra,$msg;
+
+ foreach my $log (@logdir) {
+ if (open $log,'>>',"$log/sex.log") {
+ flock $log,LOCK_EX;
+ seek $log,0,SEEK_END;
+ printf {$log} $msg;
+ close $log;
+ }