container-exception-logger(1)
=============================
NAME
----
container-exception-logger - log from a container to a host
SYNOPSIS
--------
'container-exception-logger' [--no-tag | --tag TAG | --help]
DESCRIPTION
-----------
A tool designed to run inside of a container which can get its input
outside of the container.
--no-tag::
do not add tag 'container-exception-logger' at the beginning of log message
--tag TAG::
define your own tag which will be added at the beginning of log message
Input format specification
--------------------------
It's possible to use whatever format of a message you want. Openshift logging
system (fluentd) and ABRT use JSON. For this reason, we recommend using JSON
too.
Mandatory elements
~~~~~~~~~~~~~~~~~~
Tools which parse container-exception-logger messages expecting the messages
contain following elements:
'type'::
string - exception type - Python, Python3, Ruby, etc.
'executable'::
string - the executable which caused the problem
'reason'::
string - the reason for the problem
'backtrace'::
string - the backtrace of the problem
'time'::
int - seconds since 1970-01-01 00:00:00 UTC
Optional elements
~~~~~~~~~~~~~~~~~
Additional elements can be added without any limitation. For instance 'pid', 'uid',
'msg', etc.
EXAMPLES
--------
Example of an input message:
{"type": "Python3", "executable": "/usr/bin/will_python3_raise", "reason":
"will_python3_raise:3:<module>:ZeroDivisionError: division by zero",
"backtrace": "will_python3_raise:3:<module>:ZeroDivisionError: division by
zero\n\nTraceback (most recent call last):\n File
\"/usr/bin/will_python3_raise\", line 3, in <module>\n", "time": 1521454815,
"pid": 23}
Example of the tool usage (MSG variable represents the message above):
Container:
$ echo $MSG | container-exception-logger
Host's log:
Mar 19 14:59:04 localhost dockerd-current[981]: container-exception-logger - $MSG
Container:
$ echo $MSG | container-exception-logger --no-tag
Host's log:
Mar 19 15:00:27 localhost dockerd-current[981]: $MSG
Container:
$ echo $MSG | container-exception-logger --tag new-tag
Host's log:
Mar 19 15:00:27 localhost dockerd-current[981]: new-tag - $MSG
AUTHORS
-------
* ABRT team