java - Monitor the health of weblogic server through script -
when start weblogic server, there various logs printed. structure of logging on weblogic can found on here.
i'm writing script test, whether weblogic server started successfully. need filter <error>
log messages, however, 1 condition, that, following them java exception. so, particularly failure of java bean (through thrown exceptions) criteria failure of server.
i want ignore other sorts of <error>
logs. there tool can in this?
update:
example of normal <error>
, these types of errors should ignored:
<may 29, 2015 5:02:44 pm ist> <notice> <stdout> <bea-000000> <|e |17:02:44 |2 |vgorade01 |correlationid=vgorade01_2_1432899124676 |'hotdirectory': /hot not exist: disabling service.> <may 29, 2015 5:02:44 pm ist> <error> <apm> <bea-000000> <|e |17:02:44 |2 |vgorade01 |correlationid=vgorade01_2_1432899124676 |'colddirectory': /cold not exist: disabling service.> <may 29, 2015 5:02:44 pm ist> <notice> <stdout> <bea-000000> <|e |17:02:44 |2 |vgorade01 |correlationid=vgorade01_2_1432899124676 |'colddirectory': /cold not exist: disabling service.>
example of <error>
, indicate failure, notice there stacktrace of exceptions thrown:
<may 29, 2015 11:51:37 pm idt> <error> <apm> <bea-000000> <|e |23:51:37 |com.amdocs.crm.uif.orderingbackendadapter java.lang.classnotfoundexception: com.amdocs.crm.uif.orderingbackendadapter @ weblogic.utils.classloaders.genericclassloader.findlocalclass(genericclassloader.java:335) @ weblogic.utils.classloaders.genericclassloader.findclass(genericclassloader.java:302) @ java.lang.classloader.loadclass(classloader.java:424) @ java.lang.classloader.loadclass(classloader.java:357) @ weblogic.utils.classloaders.genericclassloader.loadclass(genericclassloader.java:180) @ java.lang.class.forname0(native method) @ java.lang.class.forname(class.java:190) @ com.amdocs.uif.server.uifbackendconnector.initialize(uifbackendconnector.java:72) @ com.amdocs.uif.server.uifserverrequestresponsemgr.initializeimpl(uifserverrequestresponsemgr.java:421)
maybe small script helps. not perfect maybe need grep wls log files full log file entries go on multiple lines:
https://github.com/freeella/grepwlslogfile
$ grepwlslogfile.pl -f /path/to/adminserver.log -s error -c "exception:"
but must use log file. stdout more problematic parse because message might span multiple lines in exception , might contain unpredictable occurrences of < , >.
Comments
Post a Comment