Reporter systemd journal - abrt/libreport GitHub Wiki

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.

TODO

  • we have to specified parameter --dump, which elements will be used in each of the possibility.

Messages formatting:

There are two parts for defining format of reporters messages. The first is related to the 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)

For more information about problem report API see https://github.com/abrt/libreport/blob/master/src/include/problem_report.h

reporter-systemd-journal does not support an attach section and binary files as well. The summary section is used as main journal message.

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. The other parts of the configuration file are assigned into PROBLEM_REPORT variable. If you can have the other 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

For more information about catalog messages see https://github.com/abrt/abrt/wiki/systemd-journal-catalog-messages

TODO

  • if PROBLEM_REPORT variable is too big, the content of the variable is not shown in catalog messages. PROBLEM_REPORT variable can be read from journal fields (journalctl -o json-pretty). Problem report should be shown.
  • The piece of information which informs about using abrt command line tool should be more specific. For example "Use abrt list... --uuid a6a18be226628699e98104f0ba11020e0a58020f for further analysis or repo...". The --uuid parameter has to be added into abrt tool.
⚠️ **GitHub.com Fallback** ⚠️