- public static void main(String args[]) throws Exception
- {
- /*
- * For this example, a custom "hello" logger is created. Note that JUL
- * has a default "global" that can also be used.
- */
- Logger helloLog = Logger.getLogger("hello");
-
- /*
- * Get the LTTngAgent singelton reference. This will also initialize
- * the Agent and make it register to the session daemon if available.
- * When this returns, the Agent is registered and fully ready. If no
- * session daemon is found, it will return and retry every 3 seconds in
- * the background. TCP is used for communication.
- *
- * Note that the LTTngAgent once registered is a seperate thread in
- * your Java application.
- */
- lttngAgent = LTTngAgent.getLTTngAgent();
+ /* Instantiate a LTTngLogHandler object, and attach it to our logger */
+ Handler lttngHandler = new LttngLogHandler();
+ LOGGER.addHandler(lttngHandler);