|
| 1 | +============= |
| 2 | +FIAAS Logging |
| 3 | +============= |
| 4 | + |
| 5 | +This library configures logging according to the current FIAAS recomended format. |
| 6 | + |
| 7 | +Usage:: |
| 8 | + |
| 9 | + from fiaas_logging import init_logging |
| 10 | + |
| 11 | + init_logging(format="json") |
| 12 | + |
| 13 | + |
| 14 | +This would configure your application to emit JSON formatted logs on STDOUT. |
| 15 | + |
| 16 | +Available options (all are keyword arguments to `init_logging`): |
| 17 | + |
| 18 | + |
| 19 | +====== =============== ================================================= |
| 20 | +Key Possible values Meaning |
| 21 | +====== =============== ================================================= |
| 22 | +format `json`/`plain` Select either JSON logging, or plain text logging |
| 23 | +debug `True`/`False` Enable debug logging |
| 24 | +====== =============== ================================================= |
| 25 | + |
| 26 | +The plain format contains the fields timestamp, level name, message, logger name, and thread name. |
| 27 | +In the json format, there are more fields, with more detail. The fields in the json output are: |
| 28 | + |
| 29 | +============ ======================================================================= |
| 30 | +Name Meaning |
| 31 | +============ ======================================================================= |
| 32 | +@timestamp Timestamp of message |
| 33 | +@version Version, legacy field to support ELK stack at FINN (to be removed?) |
| 34 | +LocationInfo A structure describing the code location that logged this message |
| 35 | +message The actual log message |
| 36 | +extras A structure containing extra fields. Used for thread context |
| 37 | +throwable A formatted stacktrace if the log message is the result of an exception |
| 38 | +============ ======================================================================= |
0 commit comments