The script is as under ..
Expand|Select|Wrap|Line Numbers
- use strict;
- ####################################################################
- # genreport
- ####################################################################
- sub genreport {
- my ($logfile, $reportfile) = @_;
- my ($line, @message, @summary, $count, $match, $n);
- open(LOGFILE, "<$logfile")
- or die "Can't open $logfile: $!";
- open (REPORTFILE, ">$reportfile")
- or die "Can't open $reportfile: $!";
- $count = $match = 0;
- while ($line = <LOGFILE>) {
- chomp $line;
- if (length $line) {
- push @message, $line;
- } else {
- if ($message[0] =~ /^\[ERROR](.*)\administrator.$/) {
- #foreach $n (0..$#message) {
- # if ($message[$n] =~ /^infrastructure:ID_UNHANDLED:.*/) {
- $match = 1;
- # }
- if (($message[$n] =~ /^nested exception is:.*/) && ($match == 1)) {
- push @summary, $message[$n + 1];
- }
- # }
- if ($match == 1) {
- foreach $line (@message) {
- printf REPORTFILE "%s\n", $line;
- }
- printf REPORTFILE "\n";
- $count++;
- $match = 0;
- }
- }
- else {
- die "parse error: missing date";
- }
- @message = ();
- }
- }
- if ($count > 0) {
- printf "There were %s un-handled server exceptions:\n\n", $count;
- foreach $line (@summary) {
- printf " ***> %s\n", $line
- }
- printf "\n";
- } else {
- printf "There were no un-handled server exceptions for this reporting period.\n\n";
- }
- }
- ####################################################################
- # main
- ####################################################################
- if (@ARGV != 2) {
- die "usage: UAESummary.pl <logfile> <reportfile>";
- }
- my ($logfile, $reportfile) = @ARGV;
- genreport($logfile, $reportfile);
- exit 0;
- ############
[ERROR] [09 Sep 2008 13:58:59] [Trace] [WebContainer : 88] - infrastructure: ID_UNHANDLED: An un-handled server exception occurred. Please contact your administrator.
nested exception is:
infrastructure: RUN_ID_RUNTIME: A runtime exception occurred: javax.transacti on.RollbackExce ption.
at curam.util.tran saction.Resourc esJTA.Ô00000(Re sourcesJTA.java (Compiled Code))
at curam.util.tran saction.Transac tionInfo.commit (TransactionInf o.java(Compiled Code))
at curam.util.inte rnal.CuramSessi onBean.invoke(C uramSessionBean .java(Compiled Code))
at curam.util.inte rnal.CuramSessi onBean.invoke(C uramSessionBean .java(Inlined Compiled Code))
at curam.util.invo ke.EJSRemoteSta telessEJBMethod _51fe6ae7.invok e(EJSRemoteStat elessEJBMethod_ 51fe6ae7.java(C ompiled Code))
at sun.reflect.Gen eratedMethodAcc essor120.invoke (Unknown Source)
at sun.reflect.Del egatingMethodAc cessorImpl.invo ke(DelegatingMe thodAccessorImp l.java(Compiled Code))
at java.lang.refle ct.Method.invok e(Method.java(C ompiled Code))
at com.ibm.rmi.uti l.ProxyUtil$2.r un(ProxyUtil.ja va(Compiled Code))
at java.security.A ccessController .doPrivileged1( Native Method)
at java.security.A ccessController .doPrivileged(A ccessController .java(Compiled Code))
at com.ibm.rmi.uti l.ProxyUtil.inv okeWithPrivileg e(ProxyUtil.jav a(Compiled Code))
at com.ibm.CORBA.i iop.ClientDeleg ate.invoke(Clie ntDelegate.java (Compiled Code))
#####
When I try running it though, it returns ...
C:\PerlScripts> UAESummary.bat CuramApp.log Report.log
There were no un-handled server exceptions for this reporting period.
Even though there is clearly a string that matches the regular expression in the script, unless I am missing something.
Please help.