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.transaction.RollbackException.
at curam.util.transaction.ResourcesJTA.Ô00000(Resourc esJTA.java(Compiled Code))
at curam.util.transaction.TransactionInfo.commit(Tran sactionInfo.java(Compiled Code))
at curam.util.internal.CuramSessionBean.invoke(CuramS essionBean.java(Compiled Code))
at curam.util.internal.CuramSessionBean.invoke(CuramS essionBean.java(Inlined Compiled Code))
at curam.util.invoke.EJSRemoteStatelessEJBMethod_51fe 6ae7.invoke(EJSRemoteStatelessEJBMethod_51fe6ae7.j ava(Compiled Code))
at sun.reflect.GeneratedMethodAccessor120.invoke(Unkn own Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java(Compiled Code))
at java.lang.reflect.Method.invoke(Method.java(Compil ed Code))
at com.ibm.rmi.util.ProxyUtil$2.run(ProxyUtil.java(Co mpiled Code))
at java.security.AccessController.doPrivileged1(Nativ e Method)
at java.security.AccessController.doPrivileged(Access Controller.java(Compiled Code))
at com.ibm.rmi.util.ProxyUtil.invokeWithPrivilege(Pro xyUtil.java(Compiled Code))
at com.ibm.CORBA.iiop.ClientDelegate.invoke(ClientDel egate.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.