2 * Copyright (C) 2013 - David Goulet <dgoulet@efficios.com>
4 * This library is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License, version 2.1 only,
6 * as published by the Free Software Foundation.
8 * This library is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this library; if not, write to the Free Software Foundation,
15 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 package org
.lttng
.ust
.jul
;
20 import java
.lang
.String
;
21 import java
.util
.logging
.Handler
;
22 import java
.util
.logging
.LogRecord
;
23 import java
.util
.logging
.LogManager
;
25 import org
.lttng
.ust
.jul
.LTTngUst
;
27 public class LTTngLogHandler
extends Handler
{
28 public LogManager logManager
;
30 public LTTngLogHandler(LogManager logManager
) {
33 this.logManager
= logManager
;
35 /* Initialize LTTng UST tracer. */
40 public void close() throws SecurityException
{}
43 public void flush() {}
46 public void publish(LogRecord record
) {
48 * Specific tracepoing designed for JUL events. The source class of the
49 * caller is used for the event name, the raw message is taken, the
50 * loglevel of the record and the thread ID.
52 LTTngUst
.tracepoint(record
.getMessage(), record
.getLoggerName(),
53 record
.getSourceClassName(), record
.getSourceMethodName(),
54 record
.getMillis(), record
.getLevel().intValue(),
55 record
.getThreadID());
This page took 0.030438 seconds and 4 git commands to generate.