title: Filtering tomcat log using awk/perl
body: <p>I am trying to extract error|exception from tomcat log. Since tomcat logs have error details in multiple lines. I would like to consider every new log entry as my record i.e. date may act as a Record separator.</p>
  
  <p><code><pre>Oct 4, 2012 4:00:38 PM org.apache.catalina.loader.WebappClassLoader loadClass
  INFO: Illegal access: this web application instance has been stopped already.  Could not load com.google.common.base.Stopwatch.  The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
  java.lang.IllegalStateException
          at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1531)
          at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
          at com.myweb.ontest.stats.RpcInterceptor.intercept(RpcInterceptor.java:45)
          at com.myweb.ontest.platform.SupplySource$Iface$$EnhancerByCGLIB$$6b5e8142.finalize()
          at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)
          at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83)
          at java.lang.ref.Finalizer.access$100(Finalizer.java:14)
          at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:160)
  Oct 4, 2012 4:00:38 PM Org.apache.catalina.loader .... </code></pre></p>
  
  <p>Please let me know how it can be done using awk/perl script.</p>
  
  <p>Thanks</p>