Version 2.5.7
[lttng-ust.git] / doc / java-util-logging.txt
... / ...
CommitLineData
1The support for JUL needs to be explicitly enabled when lttng-ust is
2configured, e.g.:
3
4dependency: openjdk-7-jdk
5 ./configure --with-java-jdk=/usr/lib/jvm/java-7-openjdk --with-jni-interface
6
7On Debian system for instance you can simply use the "default-java" path:
8
9 ./configure --with-java-jdk=/usr/lib/jvm/default-java --with-jni-interface
10
11Note that the OpenJDK 7 is used for development and continuous integration thus
12we directly support that version for this library. However, it has been tested
13with OpenJDK 6 also. Please let us know if other Java version (commercial or
14not) work with this library.
15
16The LTTng Java Agent for JUL support is typically installed here:
17
18/usr/local/lib/lttng/java/liblttng-ust-jul.jar
19
20After building, you can use the "liblttng-ust-jul.jar" file in a Java project.
21It requires "liblttng-ust-jul.so" which is installed by the build system when
22doing "make install". Make sure that your Java application can find this shared
23object with the "java.library.path".
24
25In order to enable the agent in your Java application, you simply have to add
26this as early as you can in the runtime process.
27
28import org.lttng.ust.jul.LTTngAgent;
29[...]
30 private static LTTngAgent lttngAgent;
31 [...]
32 lttngAgent = LTTngAgent.getLTTngAgent();
33
34This will initialize automatically the singleton LTTngAgent, and will
35return when session daemon registration is done. If no session daemon is
36available, the execution will continue and the agent will retry every
373 seconds.
38
39Once registered, it is adds a thread inside your Java application and will be
40able to automatically use every Logger object and map them to the jul_event
41tracepoint of the JNI interface.
This page took 0.022381 seconds and 4 git commands to generate.