X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=doc%2Fjava-agent.txt;h=ae653820ef5181c57604151879319c84d9c721bd;hb=HEAD;hp=3fc6c4931e495fa2195fc7480c78af4d35ecea8b;hpb=3707dfc52ecb7e3419029da002dd04671cd7478a;p=lttng-ust.git diff --git a/doc/java-agent.txt b/doc/java-agent.txt deleted file mode 100644 index 3fc6c493..00000000 --- a/doc/java-agent.txt +++ /dev/null @@ -1,49 +0,0 @@ -The agent can be built in three different configurations: - -1) Java agent with JUL support: - -$ ./configure --enable-java-agent-jul - -2) Java agent with Log4j support: - -$ export CLASSPATH=$CLASSPATH:/path/to/log4j.jar -$ ./configure --enable-java-agent-log4j - -3) Java agent with JUL + Log4j support - -$ export CLASSPATH=$CLASSPATH:/path/to/log4j.jar -$ ./configure --enable-java-agent-all - -To build the agent with log4j support, make sure that the log4j jar -is in your Java classpath. - -The configure script will automatically detect the appropriate Java -binaries to use in order to build the Java agent. - -Enabling the JUL support will build a "lttng-ust-agent-jul.jar" file. Enabling -the log4j support will build a "lttng-ust-agent-log4j.jar". Both of these jars -depend on a third "lttng-ust-agent-common.jar", which will always be built. - -All these archives will be installed in the arch-agnostic "$prefix/share/java" -path, e.g: "/usr/share/java". You need to make sure the .jar for the logging -API you want to use (either lttng-ust-agent-jul.jar or -log4j.jar) is on your -application's classpath. - -Both logging libraries also require an architecture-specific shared object -(e.g: "liblttng-ust-jul-jni.so"), which is installed by the build system when -doing "make install". Make sure that your Java application can find this shared -object with the "java.library.path" property. - -In order to enable the agent in your Java application, you simply have to add -this as early as you can in the runtime process. - -import org.lttng.ust.agent.LTTngAgent; -[...] - private static LTTngAgent lttngAgent; - [...] - lttngAgent = LTTngAgent.getLTTngAgent(); - -This will initialize automatically the singleton LTTngAgent, and will -return when the session daemon registration is done. If no session daemon is -available, the execution will continue and the agent will retry every -3 seconds.