From: Jérémie Galarneau Date: Mon, 31 Aug 2015 22:32:16 +0000 (-0400) Subject: Don't assume that Log4j and JUL share the same log level mappings X-Git-Tag: v2.7.0-rc2~114 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=152463d94c5d1eea6394095c9a55ec5020f7dc71;p=lttng-tools.git Don't assume that Log4j and JUL share the same log level mappings We explicitly set the log level of Log4j events to LTTNG_LOGLEVEL_LOG4J_ALL instead of relying on the fact that LTTNG_LOGLEVEL_LOG4J_ALL and LTTNG_LOGLEVEL_JUL_ALL are mapped to the same value. The resulting additional branch does not seem to incur a significant performance penalty and, as such, is deemed acceptable. Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng/commands/enable_events.c b/src/bin/lttng/commands/enable_events.c index 334e00cbc..0e4fdc61e 100644 --- a/src/bin/lttng/commands/enable_events.c +++ b/src/bin/lttng/commands/enable_events.c @@ -781,8 +781,10 @@ static int enable_events(char *session_name) assert(opt_userspace || opt_jul || opt_log4j || opt_python); if (opt_userspace) { ev.loglevel = -1; - } else if (opt_jul || opt_log4j) { + } else if (opt_jul) { ev.loglevel = LTTNG_LOGLEVEL_JUL_ALL; + } else if (opt_log4j) { + ev.loglevel = LTTNG_LOGLEVEL_LOG4J_ALL; } else if (opt_python) { ev.loglevel = LTTNG_LOGLEVEL_PYTHON_DEBUG; }