Skip to content

Reporter systemd journal

Matej Habrnal edited this page Oct 7, 2016 · 7 revisions

Reporter systemd journal

reporter-systemd-journal is shipped by libreport-plugin-systemd-journal.

The tool reads problem directory DIR and sends message with its details into systemd journal.

Takes following arguments:

-m, -message-id MESSAGEID - Catalog message id.
-F FILE - Formatting file for catalog message. If the parameter is not set, reason element from problem dir is used as main log message.
-d DIR - Problem dir.
--dump NONE|ESSENTIAL|FULL - fill journal fields with text problem dir elements. If NONE, no fields will be filled (default). If ESSENTIAL, only the most important fields will be filled. If FULL, all text elements from problem dir will be filled.

Messages formatting:

There are two parts for defining format of reporters messages. The first is related to a main log message and also it is possible to add some additional information into catalog message body. This part uses ABRT's problem report API (parameter -F FILE). The second part is related to catalog messages itself and uses systemd journal catalog messages formatting (https://www.freedesktop.org/wiki/Software/systemd/catalog/).

The first part (ABRT's problem report API)

# Lines starting with # are ignored.
# Lines can be continued on the next line using trailing backslash.
#
# Format:
# %summary:: format of log message
# section:: element1[,element2]...
# The literal text line to be assigned to catalog PROBLEM_REPORT variable.
# Can be empty. (IOW: empty lines are NOT ignored!)
#
# Summary format is a line of text, where %element% is replaced by
# text element's content, and [[...%element%...]] block is used only if
# %element% exists. [[...]] blocks can nest.
#
# Sections can be:
# - %summary: log message format string.
# - text, double colon (::) and the list of comma-separated elements.
#   Text can be empty (":: elem1, elem2, elem3" works),
#   in this case "Text:" header line will be omitted.
#
# Elements can be:
# - problem directory element names, which get formatted as
#   <element_name>: <contents>
#   or
#   <element_name>:
#   :<contents>
#   :<contents>
#   :<contents>
# - problem directory element names prefixed by "%bare_",
#   which is formatted as-is, without "<element_name>:" and colons
# - %oneline, %multiline, %text wildcards, which select all corresponding
#   elements for output or attachment
# - problem directory element names prefixed by "-",
#   which excludes given element from all wildcards
#
#   Nonexistent elements are silently ignored.
#   If none of elements exists, the section will not be created.

Example (name the formatting file as abrt_test_format.conf):

%summary:: Process %pid% (%executable%) crashed in %crash_function%()

::%bare_reason

::%bare_%short_backtrace

the summary part is used for main journal message. Others parts of the configuration file are assigned into PROBLEM_REPORT variable. If you can have the others parts in catalog messages, the PROBLEM_REPORT variable has to take place in template of systemd catalog message.

The second part (systemd journal message formatting)

Example:

-- 5ab0271ecf1941a2b89299716e880661
Subject: ABRT has detected crash of @PROBLEM_EXE@
Defined-By: ABRT
Support: https://bugzilla.redhat.com/
Documentation: man:abrt(1)
@PROBLEM_REPORT@
Use abrt command line tool for further analysis or reporting
the problem to appropriate support site.

Example of use

$ reporter-systemd-journal --message-id 5ab0271ecf1941a2b89299716e880661 -F abrt_test_format.conf -d DUMP_DIRECTORY

Journal output for example above looks like folloving:

Process 15158 (will_segfault) crashed in crash()
-- Subject: ABRT has detected crash of 
-- Defined-By: ABRT
-- Support: https://bugzilla.redhat.com/
-- Documentation: man:abrt(1)
-- 
-- will_segfault killed by SIGSEGV
-- 
-- #1 crash in /usr/bin/will_segfault
-- #2 varargs in /usr/bin/will_segfault
-- #3 f in /usr/bin/will_segfault
-- #4 callback in /usr/bin/will_segfault
-- #5 call_me_back in /usr/lib64/libwillcrash.so.0.0.0
-- 
-- Use abrt command line tool for further analysis or reporting
-- the problem to appropriate support site.

Catalog messages example for each crash type

C/C++

Process 15158 (will_segfault) crashed in crash()
-- Subject: ABRT has detected crash of 
-- Defined-By: ABRT
-- Support: https://bugzilla.redhat.com/
-- Documentation: man:abrt(1)
-- 
-- will_segfault killed by SIGSEGV
-- 
-- #1 crash in /usr/bin/will_segfault
-- #2 varargs in /usr/bin/will_segfault
-- #3 f in /usr/bin/will_segfault
-- #4 callback in /usr/bin/will_segfault
-- #5 call_me_back in /usr/lib64/libwillcrash.so.0.0.0
-- 
-- Use abrt command line tool for further analysis or reporting
-- the problem to appropriate support site.

Python

Process 15214 (will_python_raise) of user 0 encountered an uncaught  exception
-- Subject: ABRT has detected an uncaught exception of ZeroDivisionError in
-- Defined-By: ABRT
-- Support: https://bugzilla.redhat.com/
-- Documentation: man:abrt(1)
-- 
-- will_python_raise:3:<module>:ZeroDivisionError: integer division or modulo by zero
-- 
-- #1 <module> in /bin/will_python_raise:3
-- 
-- Use abrt command line tool for further analysis or reporting
-- the problem to appropriate support site.

Python3

Process 18466 (will_python3_raise) of user 0 encountered an uncaught ZeroDivisionError exception
-- Subject: ABRT has detected an uncaught exception of PROBLEM_TYPE in U
-- Defined-By: ABRT
-- Support: https://bugzilla.redhat.com/
-- Documentation: man:abrt(1)
-- 
-- will_python3_raise:3:<module>:ZeroDivisionError: division by zero
-- 
-- #1 <module> in /bin/will_python3_raise:3
-- 
-- Use abrt command line tool for further analysis or reporting
-- the problem to appropriate support site.

Xorg

Display server Xorg crash in OsLookupColor()
-- Subject: ABRT has detected crash of display server
-- Defined-By: ABRT
-- Support: https://bugzilla.redhat.com/
-- Documentation: man:abrt(1)
-- 
-- Received signal 11 sent by process 4025, uid 0
-- 
-- Use abrt command line tool for further analysis or reporting
-- the problem to appropriate support site.

VMcore

System encountered a fatal error in source_load()
-- Subject: ABRT has detected a fatal system error
-- Defined-By: ABRT
-- Support: https://bugzilla.redhat.com/
-- Documentation: man:abrt(1)
-- 
-- kernel paging request at source_load
-- 
-- Use abrt command line tool for further analysis or reporting
-- the problem to appropriate support site.

Kerneloops

System encountered a non-fatal error in __warn()
-- Subject: ABRT has detected a non-fatal system error
-- Defined-By: ABRT
-- Support: https://bugzilla.redhat.com/
-- Documentation: man:abrt(1)
-- 
-- WARNING: CPU: 0 PID: 18428 at /tmp/will_oops.r3f0fwWXQ1/will_oops.c:11 will_oops_init+0x28/0x1000 [will_oops]
-- 
-- Use abrt command line tool for further analysis or reporting
-- the problem to appropriate support site.

Java

Process 18617 (willuncaught.jar) of user 0 encountered an uncaught  exception
-- Subject: ABRT has detected an uncaught exception of PROBLEM_TYPE in 
-- Defined-By: ABRT
-- Support: https://bugzilla.redhat.com/
-- Documentation: man:abrt(1)
-- PROBLEM_REPORT
-- Use abrt command line tool for further analysis or reporting
-- the problem to appropriate support site.

Ruby

Process 18902 (will_ruby_raise) of user 0 encountered an uncaught  exception
-- Subject: ABRT has detected an uncaught exception of PROBLEM_TYPE in _function
-- Defined-By: ABRT
-- Support: https://bugzilla.redhat.com/
-- Documentation: man:abrt(1)
-- PROBLEM_REPORT
-- Use abrt command line tool for further analysis or reporting
-- the problem to appropriate support site.
Clone this wiki locally