- Default File Location :
${directory of scouter.agent.jar}/plugin
- or able to configure it for example -
plugin_dir=/aaa/bbb/ccc/plugin
- Write java code on the specific text file then the code is dynamically loaded on runtime.
- plugin types
- Http-service plugin
- Service plugin
- HttpCall plugin
- Capture plugin
- JDBC-Pool plugin
void start(WrContext $ctx, WrRequest $req, WrResponse $res)
: invoked at the start of HttpServlet service() methodvoid end(WrContext $ctx, WrRequest $req, WrResponse $res)
: invoked at the end of HttpServlet service() methodboolean reject(WrContext $ctx, WrRequest $req, WrResponse $res)
: invoked at the start of HttpServlet service() method. If return true then the request is rejected
invoked when arrived the methods defined in the option hook_service_patterns
void start(WrContext $ctx, HookArgs $hook)
: invoked when a service startsvoid end(WrContext $ctx)
: invoked when a service ends
void call(WrContext $ctx, WrHttpCallRequest $req)
: invoked when an external call is invoked by httpClient and http client libraries.
invoked when arrived the methods defined in the options hook_args_patterns
, hook_return_patterns
and hook_constructor_patterns
void capArgs(WrContext $ctx, HookArgs $hook)
: invoked at the start of the methodvoid capReturn(WrContext $ctx, HookReturn $hook)
: invoked at the end of the methodvoid capThis(WrContext $ctx, String $class, String $desc, Object $this)
: invoked at a constructor
String url(WrContext $ctx, String $msg, Object $pool)
: invoked when retrieve DB Connection URL
void log(Object c)
: loggingvoid println(Object c)
: System.out.println()Object getFieldValue(Object o, String fieldName)
: get field value as object of 'o'Object invokeMethod(Object o, String methodName)
: invoke the methodObject invokeMethod(Object o, String methodName, Object[] args)
: invoke the method with argsObject invokeMethod(Object o, String methodName, Class[] argTypes, Object[] args)
: invoke the method with argsObject newInstance(String className)
: new instance of the classObject newInstance(String className, ClassLoader loader)
: new instance of the class from the classloaderObject newInstance(String className, Object[] args)
: new instance of the class with argumentsObject newInstance(String className, ClassLoader loader, Object[] args)
: new instance of the class with arguments from the classloaderObject newInstance(String className, ClassLoader loader, Class[] argTypes, Object[] args)
: new instance of the class with arguments from the classloaderString toString(Object o)
: invoke toString() of the objectString toString(Object o, String def)
: invoke toString() of the object, if null, return def.void alert(char level, String title, String message)
: invoke alert (level : i|w|e|f as info, warn, error, fatal).Class[] makeArgTypes(Class class0, Class class1, ..., classN)
: assemble argument types array to call the reflection methodinvokeMethod()
Object[] makeArgs(Object obj0, Object obj1, ..., objN)
: assemble arguments array to call the reflection methodinvokeMethod()
String service()
: get a service name of XLog from the trace contextvoid service(String name)
: set a service Name of XLog to the trace contextint serviceHash()
: get a service hash value of XLog from the trace contextvoid remoteIp(String ip)
: set a remote ip of XLog to the trace contextString remoteIp()
: get a remote ip of XLog from the trace contextvoid error(String err)
: set a error message of XLog to the trace contextboolean isError()
: if error occurred in the trace contextvoid group(String group)
: set a group name of XLog to the trace contextString group()
: get a group name of XLog from the trace contextvoid login(String id)
: set a login value of XLog to the trace contextString login()
: get a login value of XLog from the trace contextvoid desc(String desc)
: set a desc value of XLog to the trace contextString desc()
: get a desc value of XLog from the trace contextString httpMethod()
: get a http methodString httpQuery()
: get a http query stringString httpContentType()
: get a http content typeString userAgent()
: get a user agent valuevoid profile(String msg)
: profile a message to the XLog profilevoid hashProfile(String msg, int value, int elapsed)
: profile a message as hash value to the XLog profileparameterizedProfile(int level, String msgFormat, int elapsed, String[] params)
: profile a message format with parameters.- message example : "Hello, my name is %s and my age is %s"
- level : 0-debug, 1-info, 2-warn, 3-error, 4-fatal
long txid()
: get a txid of XLoglong gxid()
: get a gxid of XLogTraceContext inner()
: get raw TraceContext를 반환
String getCookie(String key)
: get a cookie of the key from the HttpRequestString getRequestURI()
: get a request uri from the HttpRequestString getRemoteAddr()
: get a remote address from the HttpRequestString getMethod()
: get a http method from the HttpRequestString getQueryString()
: get a query string from the HttpRequestString getParameter(String key)
: get a http parameter of the key from the HttpRequestObject getAttribute(String key)
: get a http request attribute of the key from the HttpRequestString getHeader(String key)
: get a http header of the key from the HttpRequestEnumeration getParameterNames()
:Enumeration getHeaderNames()
:WrSession getSession()
: get the WrSession instanceSet getSessionNames()
: get session attribute names from the HttpRequestObject getSessionAttribute(String key)
: get a session value of the keyObject inner()
: get the raw HttpRequest objectboolean isOk()
: check the plugin statusThrowable error()
: get the error that occurred when the WrRequest method called.
PrintWriter getWriter()
: get the response writerString getContentType()
: get a content type of the responseString getCharacterEncoding()
: get a encoding of the responseObject inner()
: get the raw Response objectboolean isOk()
: check the plugin statusThrowable error()
: get the error that occurred when the WrResponse method called.
Object getAttribute(String key)
:Enumeration getAttributeNames()
:Object inner()
: get the raw HttpSession objectboolean isOk()
: check the plugin statusThrowable error()
: get the error that occurred when the WrResponse method called.
void header(Object key, Object value)
: add http header before the call invokedObject inner()
: get the http call objectboolean isOk()
: check the plugin statusThrowable error()
: get the error that occurred when the WrResponse method called.
String getClassName()
: get the class name of the invoked methodString getMethodName()
: get the method name invokedString getMethodDesc()
: get the method descriptionObject getThis()
: get thisObject[] getArgs()
: get the method argumentsint getArgCount()
: get the argument count
String getClassName()
: get the class name of the invoked methodString getMethodName()
: get the method name invokedString getMethodDesc()
: get the method descriptionObject getThis()
: get thisObject getReturn()
: get a return value