I always send my arslog.pl to background (in the original arslog):
arslog.pl "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" &
exit 0
arslog.pl:
#!/usr/bin/perl -w
use strict;
use warnings;
#
# $1 - OnDemand Instance Name
# $2 - Time Stamp
# $3 - Log Identifier
# $4 - Userid
# $5 - Account
# $6 - Severity
####### 1 Alert
####### 2 Error
####### 3 Warning
####### 4 Information
####### 5 Debugging
# $7 - Message Number
# $8 - Message Text
my $scriptLogPath = "/archiv/scripts/arslog/log";
my ($odInstanceName, $odTimeStamp, $odLogIdentifier, $odUserID, $odAccount, $odSeverity, $odMessageNum, $odMessageText) = @ARGV;
if(($odSeverity == 1) or ($odSeverity == 2) or ($odSeverity == 3)) {
open(FILE, ">$scriptLogPath/$odInstanceName.$odLogIdentifier");
print FILE "$odTimeStamp\|$odUserID\|$odSeverity\|$odMessageNum\|$odMessageText";
close(FILE);
}
And now every 10 minutes my "analyzelog.pl" analyzes the files in the log path and sends out mails if the errors/warnings/alerts are worthy to send out... in this script there's more intelligence. Like Alessandro mentioned I wanted to use as less as possible systemresources for the arslog-Userexit...
Cheers