https://github.com/fiaas/logging
Python library for configuring logs in the FIAAS way
https://github.com/fiaas/logging
fiaas kubernetes logging
Last synced: about 2 months ago
JSON representation
Python library for configuring logs in the FIAAS way
- Host: GitHub
- URL: https://github.com/fiaas/logging
- Owner: fiaas
- License: apache-2.0
- Created: 2020-03-02T20:53:18.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-04-21T18:37:45.000Z (about 4 years ago)
- Last Synced: 2025-09-22T14:56:56.766Z (9 months ago)
- Topics: fiaas, kubernetes, logging
- Language: Python
- Homepage: https://fiaas.github.io/
- Size: 35.2 KB
- Stars: 0
- Watchers: 18
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
..
Copyright 2017-2019 The FIAAS Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
=============
FIAAS Logging
=============
|Build Badge| |Code quality badge| |Code coverage badge|
.. |Build Badge| image:: https://fiaas-svc.semaphoreci.com/badges/logging.svg?style=shields
:target: https://fiaas-svc.semaphoreci.com/projects/logging
.. |Code quality badge| image:: https://api.codacy.com/project/badge/Grade/735fe699137c4c1d94748d5c2525157f
:alt: Codacy Code Quality
:target: https://app.codacy.com/gh/fiaas/logging
.. |Code coverage badge| image:: https://api.codacy.com/project/badge/Coverage/b3204d1070ee4dd1a372b7d2e84ee6d1
:alt: Codacy Coverage
:target: https://www.codacy.com/gh/fiaas/logging
This library configures logging according to the current FIAAS recomended format.
Usage::
from fiaas_logging import init_logging
init_logging(format="json")
This would configure your application to emit JSON formatted logs on STDOUT.
Available options (all are keyword arguments to `init_logging`):
====== =============== =================================================
Key Possible values Meaning
====== =============== =================================================
format `json`/`plain` Select either JSON logging, or plain text logging
debug `True`/`False` Enable debug logging
====== =============== =================================================
The plain format contains the fields timestamp, level name, message, logger name, and thread name.
In the json format, there are more fields, with more detail. The fields in the json output are:
============ =======================================================================
Name Meaning
============ =======================================================================
@timestamp Timestamp of message
@version Version, legacy field to support ELK stack at FINN (to be removed?)
LocationInfo A structure describing the code location that logged this message
message The actual log message
extras A structure containing extra fields. Used for thread context
throwable A formatted stacktrace if the log message is the result of an exception
============ =======================================================================