Yes it is. I made it work actually, but now I wanted to extract the part from the stack that says "nested exception" and was having trouble with that.
The code is as below ...
- while ($line = <LOGFILE>) {
-
chomp $line;
-
if (length $line) {
-
push @message, $line;
-
if ($message[0] =~ /^\[ERROR](.*)\infrastructure:ID_UNHANDLED:.*$/) {
-
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;
-
}
-
}
The report I get is as below ...
[ERROR] [09 Sep 2008 12:36:56] [Trace] [WebContainer : 78] - infrastructure:ID_UNHANDLED: An un-handled server exception occurred. Please contact your administrator.
[ERROR] [09 Sep 2008 12:55:23] [Trace] [WebContainer : 83] - infrastructure:ID_UNHANDLED: An un-handled server exception occurred. Please contact your administrator.
[ERROR] [09 Sep 2008 12:55:36] [Trace] [WebContainer : 80] - infrastructure:ID_UNHANDLED: An un-handled server exception occurred. Please contact your administrator.
[ERROR] [09 Sep 2008 12:57:54] [Trace] [WebContainer : 77] - infrastructure:ID_UNHANDLED: An un-handled server exception occurred. Please contact your administrator.
This is part of the input log(in addition to the 1st line that's captured above, I want the part below the "nested exception is:" string to be displayed too ...
[ERROR] [10 Sep 2008 10:13:17] [Trace] [WebContainer : 144] - infrastructure:ID_UNHANDLED: An un-handled server exception occurred. Please contact your administrator.
at curam.util.internal.HandleException.getRemoteExcep tion(HandleException.java(Compiled Code))
at curam.util.internal.HandleException.getRemoteExcep tion(HandleException.java(Compiled Code))
at curam.util.internal.CuramSessionBean.o00000(CuramS essionBean.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))
nested exception is:
infrastructure:RUN_ID_RECORD_NOT_FOUND: Record not found.
at curam.util.dataaccess.DatabaseCall.o00000(Database Call.java(Compiled Code))
at curam.util.dataaccess.DatabaseCall.o00000(Database Call.java(Compiled Code))
at curam.util.dataaccess.DatabaseCall.execute(Databas eCall.java(Compiled Code))
at curam.fem.entity.base.EMChecklist.read(EMChecklist .java(Compiled Code))
at curam.fem.facade.impl.EMChecklist.doNothing(EMChec klist.java(Compiled Code))
at sun.reflect.GeneratedMethodAccessor874.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 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))