<td><a href="https://docs.oracle.com/javase/8/docs/api/java/util/logging/package-summary.html"><code>java.util.logging</code></a> (JUL)
<td>#LTTNG_DOMAIN_JUL
<tr>
- <td><a href="https://logging.apache.org/log4j/1.2/">Apache log4j</a>
+ <td><a href="https://logging.apache.org/log4j/1.x/">Apache Log4j 1.x</a>
<td>#LTTNG_DOMAIN_LOG4J
+ <tr>
+ <td><a href="https://logging.apache.org/log4j/2.x/">Apache Log4j 2</a>
+ <td>#LTTNG_DOMAIN_LOG4J2
<tr>
<td><a href="https://docs.python.org/3/library/logging.html">Python logging</a>
<td>#LTTNG_DOMAIN_PYTHON
A channel is always associated to a \lt_obj_domain.
The \link #LTTNG_DOMAIN_JUL <code>java.util.logging</code>\endlink,
-\link #LTTNG_DOMAIN_LOG4J Apache log4j\endlink, and
+\link #LTTNG_DOMAIN_LOG4J Apache Log4j 1.x\endlink,
+\link #LTTNG_DOMAIN_LOG4J2 Apache Log4j 2\endlink, and
\link #LTTNG_DOMAIN_PYTHON Python\endlink tracing
domains each have a default channel which you can't configure.
<code>lttng_log4j:event</code>
Such an event record has a string field <code>logger_name</code>
- which contains the name of the Apache log4j logger from which
+ which contains the name of the Apache Log4j 1.x logger from which
+ LTTng creates \lt_var{E}.
+ <tr>
+ <td>#LTTNG_DOMAIN_LOG4J2
+ <td>#LTTNG_EVENT_TRACEPOINT
+ <td>
+ <code>lttng_log4j2:event</code>
+
+ Such an event record has a string field <code>logger_name</code>
+ which contains the name of the Apache Log4j 2 logger from which
LTTng creates \lt_var{E}.
<tr>
<td>#LTTNG_DOMAIN_PYTHON
[verse]
*lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *add-context*
- (option:--kernel | option:--userspace | option:--jul | option:--log4j)
+ (option:--kernel | option:--userspace | option:--jul | option:--log4j | option:--log4j2)
[option:--session='SESSION'] [option:--channel='CHANNEL']
option:--type='TYPE' [option:--type='TYPE']...
Per-thread::
Prefix: `perf:thread:`
+
-Only available with the option:--userspace, option:--jul, or
-option:--log4j option.
+Only available with the option:--userspace, option:--jul,
+option:--log4j, or option:--log4j2 option.
--
+
Add Performance Monitoring Unit (PMU) counter context fields by raw ID
with the ++perf:cpu:raw:r++__N__++:++__NAME__ (option:--kernel option)
or ++perf:thread:raw:r++__N__++:++__NAME__ (option:--userspace,
-option:--jul, or option:--log4j option) types, with:
+option:--jul, option:--log4j, or option:--log4j2 option) types, with:
+
--
'N'::
Context type name.
--
+
-Only available with the option:--jul and option:--log4j options.
+Only available with the option:--jul, option:--log4j and option:--log4j2 options.
IMPORTANT: Make sure to **single-quote** 'TYPE' when you run the
`add-context` command from a shell, as `$` is a special character for
option:-l, option:--log4j::
Add context fields to be recorded to the event records of one or
- more channels of the Apache log4j tracing domain.
+ more channels of the Apache Log4j 1.x tracing domain.
+
+option:--log4j2::
+ Add context fields to be recorded to the event records of one or
+ more channels of the Apache Log4j 2 tracing domain.
option:-u, option:--userspace::
Add context fields to be recorded to the event records of one or
List the available Linux kernel tracepoints with
`lttng list --userspace`. See man:lttng-list(1) to learn more.
-`java.util.logging`, Apache log4j, and Python::
+`java.util.logging`, Apache Log4j 1.x, Apache Log4j 2, and Python::
Java or Python logging statement:::
A method call on a Java or Python logger attached to an
LTTng-UST handler.
+
List the available Java and Python loggers with `lttng list --jul`,
-`lttng list --log4j`, and `lttng list --python`. See man:lttng-list(1)
-to learn more.
+`lttng list --log4j`, `lttng list --log4j2`, and `lttng list --python`. See
+man:lttng-list(1) to learn more.
[[trigger]]
|nloption:--type option starts with `jul:`
|nloption:--jul
-|Apache log4j
+|Apache Log4j 1.x
|nloption:--type option starts with `log4j:`
|nloption:--log4j
+|Apache Log4j 2
+|nloption:--type option starts with `log4j2:`
+|nloption:--log4j2
+
|Python
|nloption:--type option starts with `python:`
|nloption:--python
A channel is always associated to a tracing domain (see the
``<<domain,{sect-domain}>>'' section below). The `java.util.logging`
-(JUL), log4j, and Python tracing domains each have a default channel
+(JUL), log4j, log4j2 and Python tracing domains each have a default channel
which you can't configure.
A channel owns recording event rules.
[verse]
*lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *disable-event*
- (option:--userspace | option:--jul | option:--log4j | option:--python) [option:--tracepoint]
+ (option:--userspace | option:--jul | option:--log4j | option:--log4j2 |option:--python) [option:--tracepoint]
(option:--all-events | 'NAME'[,'NAME']...)
[option:--session='SESSION'] [option:--channel='CHANNEL']
Disable recording event rules in the Linux kernel domain.
option:-l, option:--log4j::
- Disable recording event rules in the Apache log4j domain.
+ Disable recording event rules in the Apache Log4j 1.x domain.
+
+option:--log4j2::
+ Disable recording event rules in the Apache Log4j 2 domain.
option:-p, option:--python::
Disable recording event rules in the Python domain.
--
With the option:--kernel or option:--userspace option:::
LTTng tracepoint events.
-With the option:--jul, option:--log4j, or option:--python option:::
+With the option:--jul, option:--log4j, option:--log4j2, or option:--python option:::
Logging events.
--
----
====
-.Disable specific Apache log4j recording event rules in the default channel of a specific recording session.
+.Disable specific Apache Log4j 1.x recording event rules in the default channel of a specific recording session.
====
See the option:--session option.
Java/Python logging events:
[verse]
-*lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *enable-event* (option:--jul | option:--log4j | option:--python)
+*lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *enable-event* (option:--jul | option:--log4j | option:--log4j2 | option:--python)
[option:--tracepoint] (option:--all | 'NAME'[,'NAME']...)
[option:--loglevel='LOGLEVEL' | option:--loglevel-only='LOGLEVEL'] [option:--filter='EXPR']
[option:--session='SESSION'] [option:--channel='CHANNEL']
List the available user space tracepoints with `lttng list --userspace`.
See man:lttng-list(1) to learn more.
-For the `java.util.logging` (option:--jul option), Apache log4j (option:--log4j option), and Python (option:--python option) tracing domains::
+For the `java.util.logging` (option:--jul option), Apache 1.x log4j (option:--log4j option), Apache 2.x log4j (option:--log4j2 option), and Python (option:--python option) tracing domains::
With or without the option:--tracepoint option:::
A logging statement.
+
As of LTTng{nbsp}{lttng_version}, this is the default and sole
-instrumentation point type of the `java.util.logging`, Apache log4j, and
-Python tracing domains, but this may change in the future.
+instrumentation point type of the `java.util.logging`, Apache Log4j 1.x, Apache
+log4j 2.x, and Python tracing domains, but this may change in the future.
+
List the available Java and Python loggers with `lttng list --jul`,
-`lttng list --log4j`, and `lttng list --python`. See man:lttng-list(1)
-to learn more.
+`lttng list --log4j`, `lttng list --log4j2`, and `lttng list --python`.
+See man:lttng-list(1) to learn more.
[[event-name-cond]]
* `FINEST` (300)
* `ALL` (`INT32_MIN`)
-Apache log4j (option:--log4j option)::
+Apache Log4j 1.x (option:--log4j option)::
+
* `OFF` (`INT32_MAX`)
* `FATAL` (50000)
* `TRACE` (5000)
* `ALL` (`INT32_MIN`)
+Apache Log4j 2 (option:--log4j2 option)::
++
+* `OFF` (`0`)
+* `FATAL` (100)
+* `ERROR` (200)
+* `WARN` (300)
+* `INFO` (400)
+* `DEBUG` (500)
+* `TRACE` (600)
+* `ALL` (`INT32_MAX`)
+
Python (option:--python option)::
+
* `CRITICAL` (50)
name of the `java.util.logging` logger from which LTTng
creates{nbsp}__E__.
-Apache log4j logging statement (option:--log4j and option:--tracepoint options)::
+Apache Log4j 1.x logging statement (option:--log4j and option:--tracepoint options)::
`lttng_log4j:event`
+
Such an event record has a string field `logger_name` which contains the
-name of the Apache log4j logger from which LTTng creates{nbsp}__E__.
+name of the Apache Log4j 1.x logger from which LTTng creates{nbsp}__E__.
+
+Apache Log4j 2 logging statement (option:--log4j2 and option:--tracepoint options)::
+ `lttng_log4j2:event`
++
+Such an event record has a string field `logger_name` which contains the
+name of the Apache Log4j 2 logger from which LTTng creates{nbsp}__E__.
Python logging statement (option:--python and option:--tracepoint options)::
`lttng_python:event`
domain.
option:-l, option:--log4j::
- Create or enable recording event rules in the Apache log4j tracing
+ Create or enable recording event rules in the Apache Log4j 1.x tracing
+ domain.
+
+option:--log4j2::
+ Create or enable recording event rules in the Apache Log4j 2 tracing
domain.
option:-p, option:--python::
+
With the option:--kernel or option:--userspace option:::
LTTng tracepoint events.
-With the option:--jul, option:--log4j, or option:--python option:::
+With the option:--jul, option:--log4j, option:--log4j2, or option:--python option:::
Logging events.
With the option:--kernel, not specifying any of the instrumentation
point type options is equivalent to specifying the option:--tracepoint
option, but this default may change in the future.
-With the option:--userspace, option:--jul, option:--log4j, and
+With the option:--userspace, option:--jul, option:--log4j, option:--log4j2, and
option:--python options, not specifying the option:--tracepoint option
is equivalent to specifying it, but this default may change in the
future.
----
====
-.Create a recording event rule which matches Apache log4j logging events with a specific log level range (current recording session, specific channel).
+.Create a recording event rule which matches Apache Log4j 1.x logging events with a specific log level range (current recording session, specific channel).
====
See the option:--channel, option:--all, and option:--loglevel options.
----
====
+.Create a recording event rule which matches Apache Log4j 2 logging events with a specific log level range (current recording session, specific channel).
+====
+See the option:--channel, option:--all, and option:--loglevel options.
+
+[role="term"]
+----
+$ lttng enable-event --log4j2 --channel=my-loggers \
+ --all --loglevel=INFO
+----
+====
+
.Create a recording event rule which matches specific Linux kprobe events (current recording session, default channel).
====
The recording event rule below matches the entry of `usb_disconnect()`
Specify an event rule to match Java/Python logging events:
[verse]
-option:--type=(**jul** | **log4j** | **python**)**:logging** [option:--name='NAME']
+option:--type=(**jul** | **log4j** | **log4j2** | **python**)**:logging** [option:--name='NAME']
pass:[[]option:--log-level=('LOGLEVEL' | 'LOGLEVEL'.. | ..)] [option:--filter='EXPR']
See man:lttng-list(1) to learn more.
`log4j:logging`::
- An Apache log4j logging statement.
+ An Apache Log4j 1.x logging statement.
+
-List the available Apache log4j loggers with `lttng list --log4j`
+List the available Apache Log4j 1.x loggers with `lttng list --log4j`
+See man:lttng-list(1) to learn more.
+
+`log4j2:logging`::
+ An Apache Log4j 2 logging statement.
++
+List the available Apache Log4j 2 loggers with `lttng list --log4j2`
See man:lttng-list(1) to learn more.
`python:logging`::
`jul:logging`::
`log4j:logging`::
+`log4j2:logging`::
`python:logging`::
The name of the Java or Python logger from which LTTng
creates{nbsp}__E__.
* `TRACE` (5000)
* `ALL` (`INT32_MIN`)
+`log4j2:logging`::
++
+* `OFF` (`0`)
+* `FATAL` (100)
+* `ERROR` (200)
+* `WARN` (300)
+* `INFO` (400)
+* `DEBUG` (500)
+* `TRACE` (600)
+* `ALL` (`INT32_MAX`)
+
`python:logging`::
+
* `CRITICAL` (50)
|nloption:--log4j and nloption:--tracepoint
|option:--type=++log4j:logging++
+|nloption:--log4j2 and nloption:--tracepoint
+|option:--type=++log4j2:logging++
+
|nloption:--python and nloption:--tracepoint
|option:--type=++python:logging++
in the future.
`log4j:logging`:::
- Apache log4j logging statement.
+ Apache Log4j 1.x logging statement.
+
As of LTTng{nbsp}{lttng_version}, `log4j` is an alias, but this may
change in the future.
+`log4j2:logging`:::
+ Apache Log4j 2 logging statement.
++
+As of LTTng{nbsp}{lttng_version}, `log4j2` is an alias, but this may
+change in the future.
+
`python:logging`:::
Python logging statement.
+
`jul:logging`::
`log4j:logging`::
+`log4j2:logging`::
`python:logging`::
The Java or Python logger name.
[verse]
*lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *list* [option:--channel='CHANNEL'] 'SESSION'
- [option:--kernel] [option:--userspace] [option:--jul] [option:--log4j] [option:--python]
+ [option:--kernel] [option:--userspace] [option:--jul] [option:--log4j] [option:--log4j2] [option:--python]
List the available LTTng tracepoints, Linux system calls, and/or
Java/Python loggers:
[verse]
*lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *list* [option:--fields]
- [option:--kernel [option:--syscall]] [option:--userspace] [option:--jul] [option:--log4j] [option:--python]
+ [option:--kernel [option:--syscall]] [option:--userspace] [option:--jul] [option:--log4j] [option:--log4j2] [option:--python]
DESCRIPTION
their recording event rules.
+
Use the dedicated tracing domain options (option:--kernel,
-option:--userspace, option:--jul, option:--log4j, and option:--python)
-to only show specific channels.
+option:--userspace, option:--jul, option:--log4j, option:--log4j2, and
+option:--python) to only show specific channels.
Without the 'SESSION' argument and with at least one dedicated tracing domain option::
+
The available, instrumented Linux system calls.
With the option:--userspace option::
The available LTTng user space tracepoints.
-With the option:--jul, option:--log4j, and/or option:--python options::
- The available `java.util.logging`, Apache log4j, and/or Python
+With the option:--jul, option:--log4j, option:--log4j2, and/or option:--python options::
+ The available `java.util.logging`, Apache Log4j 1.x, Apache Log4j 2 and/or Python
logger names.
--
+
option:-l, option:--log4j::
Without the 'SESSION' argument:::
- List the Apache log4j logger names.
+ List the Apache Log4j 1.x logger names.
With the 'SESSION' argument:::
- Only list the Apache log4j channels and their recording event
+ Only list the Apache Log4j 1.x channels and their recording event
+ rules.
+
+option:--log4j2::
+ Without the 'SESSION' argument:::
+ List the Apache Log4j 2 logger names.
+ With the 'SESSION' argument:::
+ Only list the Apache Log4j 2 channels and their recording event
rules.
option:-p, option:--python::