Index
This document expalins the detail configuration of beSee. The
ChainingPreProcessor
is the main element (chain centric) of beSee.
The
ChainedPreProcessors
are elements you can declare in the configuration to reach your instrumentation requirements.
Some of them targets global behavoir - like the
CFlowPreProcessor
- and other allows fine grained instrumentation - like
AllMethodsPreProcessor
.
confDirective = this is a multi line value\ of the configuration directive confDirective\ that is written with 3 lines. Basic PreProcessorPurpose
The Basic PreProcessor can be used to understand better how the BEA Class PreProcessor technology works and interacts with your deployed applications. This PreProcessor
prints out on the server stdout a message when the PreProcessor is loaded and initialized and each time the bytecode of a class being loaded goes thru it.
Usage
Chaining PreProcessorPurpose
The Chaining PreProcessor handles any number of PreProcessor and registers them in a chain. During the loading of a class, it applies every Chained PreProcessor matching
some criteria (className like ..., className not like ..., method like ...).
Usage
The following details the syntax of the besee.properties file.
Hot reload
The Chaining PreProcessor registers itself in the JMX server (if available) under the name
com.gnilux.besee:service=HotPreProcessorChain
.
Use any JMX client application to see the current chain loaded or to recreate the chain by re-readiing the configuration file set thru -Dbesee.conf.
Chained PreProcessorUsage
Chained PreProcessor are PreProcessors that are registered in the Chaining PreProcessor.
All Chained PreProcessor share common properties when used within the Chaining PreProcessor, and have also specific properties.
# understand what is called # NAME of a Chained PreProcessor # PROPERTY of a Chained PreProcessor # here the NAME is "A'. This will add an instance of ppClassName PreProcessor in the chain. besee.A = com.gnilux.besee.ppClassName # here a PROPERTY of A is "sampleProperty", its value is "sample". Case is of concern. # YOU SHOULD NOT THE INHERITED SYNTAX besee.NAME.PROPERTY besee.A.sampleProperty = sample ... Shared Properties
All Chained PreProcessor are using there full className as log4j logger to log various internal information.
Stdout PreProcessor
The com.gnilux.besee.preprocessor.StdoutPreProcessor prints in its log4j logger the className of the class that is beeing instrumented.
# sample besee.A = com.gnilux.besee.preprocessor.StdoutPreProcessor besee.A.next = B besee.A.classMatch = org.apache.struts.webapp..* Trace PreProcessorThe com.gnilux.preprocessor.TracePreProcessor acts at method level and instruments easily all wished methods off classes by adding log4j log call just before the method executes and just after the method returns (including when an exception is thrown).
# sample besee.Z = com.gnilux.besee.preprocessor.TracePreProcessor besee.Z.next = AA besee.Z.classMatch = com.gnilux.besee.test.trace.* besee.Z.logger = besee.test besee.Z.fullName = 0 besee.Z.verboseIn = 0 besee.Z.verboseOut = 2 besee.Z.cflowSP = 1 besee.Z.mt.modifier=(public|private|protected) AllMethods PreProcessor
The com.gnilux.preprocessor.AllMethodsPreProcessor acts at method level and instruments easily all wished methods off classes in the way you want it.
besee.B = com.gnilux.besee.preprocessor.AllMethodsPreProcessor besee.B.next = C besee.B.classMatch = com.gnilux.besee.test.(SimplePPTestCase|SuperFoo|Foo|Bar) besee.B.ct.before ={\ com.gnilux.besee.log.LoggerFactory.getLogger("besee.test")\ .debug($$cflowSP + " new $$className()");\ java.lang.System.out.println("hello $$className");\ } besee.B.ct.after =\ com.gnilux.besee.log.LoggerFactory.getLogger("besee.test")\ .debug($$cflowSP +"_new $$className()"); besee.B.mt.before =\ com.gnilux.besee.log.LoggerFactory.getLogger("besee.test")\ .debug($$cflowSP +" $$className.$$method(" +\ com.gnilux.besee.util.StringUtil.dumpTypeValueArray($args)+")"); besee.B.mt.after =\ com.gnilux.besee.log.LoggerFactory.getLogger("besee.test")\ .debug($$cflowSP +"_$$className.$$method(" +\ com.gnilux.besee.util.StringUtil.dumpValueArray($args)+") = " +\ com.gnilux.besee.util.StringUtil.dumpValueArray(($w)$_) ); besee.B.mt.modifier=(public|private|protected) CFlow PreProcessorThe com.gnilux.preprocessor.CFlowPreProcessor acts transparently at method level and instruments all wished methods off classes to add the flow depth support . It should be configured last in the chain when used to interact correctly with cflowSP and cflow substitution at runtime in AllMethodsPreProcessor and TracePreProcessor.
########################################################## # last PP in chain to enable $$cflow and $$cflowSP ########################################################## besee.AA = com.gnilux.besee.preprocessor.CflowPreProcessor besee.AA.next = besee.AA.classMatch = com.gnilux.besee.test.* |