jni-header.stamp
jul-jni-header.stamp
log4j-jni-header.stamp
-org_lttng_ust_agent_jul_LttngLogHandler.h
-org_lttng_ust_agent_log4j_LttngLogAppender.h
+org_lttng_ust_agent_jul_LttngJulApi.h
+org_lttng_ust_agent_log4j_LttngLog4jApi.h
# Python agent
python-lttngust/lttngust/__init__.py
juljniout = ../../jni/jul
dist_noinst_JAVA = $(pkgpath)/LttngJulAgent.java \
+ $(pkgpath)/LttngJulApi.java \
$(pkgpath)/LttngLogHandler.java
dist_noinst_DATA = $(jarfile_manifest)
$(JAR) cfm $(JARFLAGS) $@ $(jarfile_manifest) $(classes) && rm -f $(jarfile_symlink) && $(LN_S) $@ $(jarfile_symlink)
jul-jni-header.stamp: $(dist_noinst_JAVA)
- $(JAVAH) -classpath $(CLASSPATH):$(srcdir) -d $(juljniout) $(JAVAHFLAGS) org.lttng.ust.agent.jul.LttngLogHandler && \
+ $(JAVAH) -classpath $(CLASSPATH):$(srcdir) -d $(juljniout) $(JAVAHFLAGS) org.lttng.ust.agent.jul.LttngJulApi && \
echo "JUL JNI header generated" > jul-jni-header.stamp
all-local: $(stamp)
cd $(DESTDIR)/$(jardir) && rm -f $(jarfile_symlink)
CLEANFILES = $(jarfile) $(pkgpath)/*.class jul-jni-header.stamp \
- $(juljniout)/org_lttng_ust_agent_jul_LttngLogHandler.h
+ $(juljniout)/org_lttng_ust_agent_jul_LttngJulApi.h
--- /dev/null
+/*
+ * Copyright (C) 2016 - EfficiOS Inc., Alexandre Montplaisir <alexmonthy@efficios.com>
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License, version 2.1 only,
+ * as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.lttng.ust.agent.jul;
+
+/**
+ * Virtual class containing the Java side of the LTTng-JUL JNI API methods.
+ *
+ * @author Alexandre Montplaisir
+ */
+final class LttngJulApi {
+
+ private LttngJulApi() {}
+
+ static native void tracepoint(String msg,
+ String logger_name,
+ String class_name,
+ String method_name,
+ long millis,
+ int log_level,
+ int thread_id);
+}
* caller is used for the event name, the raw message is taken, the
* loglevel of the record and the thread ID.
*/
- tracepoint(formattedMessage,
+ LttngJulApi.tracepoint(formattedMessage,
record.getLoggerName(),
record.getSourceClassName(),
record.getSourceMethodName(),
record.getThreadID());
}
- /* Send tracepoint information to the JNI library */
- private native void tracepoint(String msg,
- String logger_name,
- String class_name,
- String method_name,
- long millis,
- int log_level,
- int thread_id);
}
log4jjniout = ../../jni/log4j
dist_noinst_JAVA = $(pkgpath)/LttngLog4jAgent.java \
+ $(pkgpath)/LttngLog4jApi.java \
$(pkgpath)/LttngLogAppender.java
dist_noinst_DATA = $(jarfile_manifest)
$(JAR) cfm $(JARFLAGS) $@ $(jarfile_manifest) $(classes) && rm -f $(jarfile_symlink) && $(LN_S) $@ $(jarfile_symlink)
log4j-jni-header.stamp: $(dist_noinst_JAVA)
- $(JAVAH) -classpath $(CLASSPATH):$(srcdir) -d $(log4jjniout) $(JAVAHFLAGS) org.lttng.ust.agent.log4j.LttngLogAppender && \
+ $(JAVAH) -classpath $(CLASSPATH):$(srcdir) -d $(log4jjniout) $(JAVAHFLAGS) org.lttng.ust.agent.log4j.LttngLog4jApi && \
echo "Log4j JNI header generated" > log4j-jni-header.stamp
all-local: $(stamp)
cd $(DESTDIR)/$(jardir) && rm -f $(jarfile_symlink)
CLEANFILES = $(jarfile) $(pkgpath)/*.class log4j-jni-header.stamp \
- $(log4jjniout)/org_lttng_ust_agent_log4j_LttngLogAppender.h
+ $(log4jjniout)/org_lttng_ust_agent_log4j_LttngLog4jApi.h
--- /dev/null
+/*
+ * Copyright (C) 2016 - EfficiOS Inc., Alexandre Montplaisir <alexmonthy@efficios.com>
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License, version 2.1 only,
+ * as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.lttng.ust.agent.log4j;
+
+/**
+ * Virtual class containing the Java side of the LTTng-log4j JNI API methods.
+ *
+ * @author Alexandre Montplaisir
+ */
+final class LttngLog4jApi {
+
+ private LttngLog4jApi() {}
+
+ static native void tracepoint(String msg,
+ String logger_name,
+ String class_name,
+ String method_name,
+ String file_name,
+ int line_number,
+ long timestamp,
+ int loglevel,
+ String thread_name);
+}
}
eventCount.incrementAndGet();
- tracepoint(event.getRenderedMessage(),
+
+ LttngLog4jApi.tracepoint(event.getRenderedMessage(),
event.getLoggerName(),
event.getLocationInformation().getClassName(),
event.getLocationInformation().getMethodName(),
event.getThreadName());
}
-
- /* Use for a user session daemon. */
- private native void tracepoint(String msg,
- String logger_name,
- String class_name,
- String method_name,
- String file_name,
- int line_number,
- long timestamp,
- int loglevel,
- String thread_name);
}
liblttng_ust_jul_jni_la_SOURCES = lttng_ust_jul.c \
lttng_ust_jul.h
-nodist_liblttng_ust_jul_jni_la_SOURCES = org_lttng_ust_agent_jul_LttngLogHandler.h
+nodist_liblttng_ust_jul_jni_la_SOURCES = org_lttng_ust_agent_jul_LttngJulApi.h
liblttng_ust_jul_jni_la_LIBADD = -lc -L$(top_builddir)/liblttng-ust/.libs -llttng-ust
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "org_lttng_ust_agent_jul_LttngLogHandler.h"
+#include "org_lttng_ust_agent_jul_LttngJulApi.h"
#define TRACEPOINT_DEFINE
#define TRACEPOINT_CREATE_PROBES
/*
* Tracepoint used by Java applications using the JUL handler.
*/
-JNIEXPORT void JNICALL Java_org_lttng_ust_agent_jul_LttngLogHandler_tracepoint(JNIEnv *env,
+JNIEXPORT void JNICALL Java_org_lttng_ust_agent_jul_LttngJulApi_tracepoint(JNIEnv *env,
jobject jobj,
jstring msg,
jstring logger_name,
liblttng_ust_log4j_jni_la_SOURCES = lttng_ust_log4j.c \
lttng_ust_log4j.h
-nodist_liblttng_ust_log4j_jni_la_SOURCES = org_lttng_ust_agent_log4j_LttngLogAppender.h
+nodist_liblttng_ust_log4j_jni_la_SOURCES = org_lttng_ust_agent_log4j_LttngLog4jApi.h
liblttng_ust_log4j_jni_la_LIBADD = -lc -L$(top_builddir)/liblttng-ust/.libs -llttng-ust
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "org_lttng_ust_agent_log4j_LttngLogAppender.h"
+#include "org_lttng_ust_agent_log4j_LttngLog4jApi.h"
#define TRACEPOINT_DEFINE
#define TRACEPOINT_CREATE_PROBES
/*
* System tracepoint meaning only root agent will fire this.
*/
-JNIEXPORT void JNICALL Java_org_lttng_ust_agent_log4j_LttngLogAppender_tracepoint(JNIEnv *env,
+JNIEXPORT void JNICALL Java_org_lttng_ust_agent_log4j_LttngLog4jApi_tracepoint(JNIEnv *env,
jobject jobj,
jstring msg,
jstring logger_name,