c887f7f414e5602f0e72be0f543a261aeb4c838b
2 * Copyright (C) 2011-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; only
7 * version 2.1 of the License.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 #include "org_lttng_ust_agent_log4j_LTTngLogAppender.h"
21 #define TRACEPOINT_DEFINE
22 #define TRACEPOINT_CREATE_PROBES
23 #include "lttng_ust_log4j.h"
26 * System tracepoint meaning only root agent will fire this.
28 JNIEXPORT
void JNICALL
Java_org_lttng_ust_agent_log4j_LTTngLogAppender_tracepointS(JNIEnv
*env
,
41 const char *msg_cstr
= (*env
)->GetStringUTFChars(env
, msg
, &iscopy
);
42 const char *logger_name_cstr
= (*env
)->GetStringUTFChars(env
, logger_name
, &iscopy
);
43 const char *class_name_cstr
= (*env
)->GetStringUTFChars(env
, class_name
, &iscopy
);
44 const char *method_name_cstr
= (*env
)->GetStringUTFChars(env
, method_name
, &iscopy
);
45 const char *file_name_cstr
= (*env
)->GetStringUTFChars(env
, file_name
, &iscopy
);
46 const char *thread_name_cstr
= (*env
)->GetStringUTFChars(env
, thread_name
, &iscopy
);
48 tracepoint(lttng_log4j
, sys_event
, msg_cstr
, logger_name_cstr
,
49 class_name_cstr
, method_name_cstr
, file_name_cstr
,
50 line_number
, timestamp
, loglevel
, thread_name_cstr
);
52 (*env
)->ReleaseStringUTFChars(env
, msg
, msg_cstr
);
53 (*env
)->ReleaseStringUTFChars(env
, logger_name
, logger_name_cstr
);
54 (*env
)->ReleaseStringUTFChars(env
, class_name
, class_name_cstr
);
55 (*env
)->ReleaseStringUTFChars(env
, method_name
, method_name_cstr
);
56 (*env
)->ReleaseStringUTFChars(env
, file_name
, file_name_cstr
);
57 (*env
)->ReleaseStringUTFChars(env
, thread_name
, thread_name_cstr
);
61 * User tracepoint meaning only a non root agent will fire this.
63 JNIEXPORT
void JNICALL
Java_org_lttng_ust_agent_log4j_LTTngLogAppender_tracepointU(JNIEnv
*env
,
76 const char *msg_cstr
= (*env
)->GetStringUTFChars(env
, msg
, &iscopy
);
77 const char *logger_name_cstr
= (*env
)->GetStringUTFChars(env
, logger_name
, &iscopy
);
78 const char *class_name_cstr
= (*env
)->GetStringUTFChars(env
, class_name
, &iscopy
);
79 const char *method_name_cstr
= (*env
)->GetStringUTFChars(env
, method_name
, &iscopy
);
80 const char *file_name_cstr
= (*env
)->GetStringUTFChars(env
, file_name
, &iscopy
);
81 const char *thread_name_cstr
= (*env
)->GetStringUTFChars(env
, thread_name
, &iscopy
);
83 tracepoint(lttng_log4j
, user_event
, msg_cstr
, logger_name_cstr
,
84 class_name_cstr
, method_name_cstr
, file_name_cstr
,
85 line_number
, timestamp
, loglevel
, thread_name_cstr
);
87 (*env
)->ReleaseStringUTFChars(env
, msg
, msg_cstr
);
88 (*env
)->ReleaseStringUTFChars(env
, logger_name
, logger_name_cstr
);
89 (*env
)->ReleaseStringUTFChars(env
, class_name
, class_name_cstr
);
90 (*env
)->ReleaseStringUTFChars(env
, method_name
, method_name_cstr
);
91 (*env
)->ReleaseStringUTFChars(env
, file_name
, file_name_cstr
);
92 (*env
)->ReleaseStringUTFChars(env
, thread_name
, thread_name_cstr
);
This page took 0.030275 seconds and 3 git commands to generate.