Metadata-Version: 2.1
Name: fiaas-logging
Version: 0.1.1
Summary: Python library for configuring logs in the FIAAS way
Home-page: https://github.com/fiaas/logging
Author: FIAAS developers
Author-email: fiaas@googlegroups.com
License: Apache License
Keywords: kubernetes fiaas logging
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Topic :: Internet
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Provides-Extra: dev
Requires-Dist: pytest (==4.6.9) ; extra == 'dev'
Requires-Dist: pytest-cov (==2.8.1) ; extra == 'dev'
Requires-Dist: pytest-html (==1.22.1) ; extra == 'dev'
Requires-Dist: pytest-sugar (==0.9.2) ; extra == 'dev'
Requires-Dist: callee (==0.3.1) ; extra == 'dev'
Requires-Dist: mock (==3.0.5) ; extra == 'dev'
Requires-Dist: prospector ; extra == 'dev'
Provides-Extra: release
Requires-Dist: publish ; extra == 'release'

..
  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|

.. |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 Badge
   :target: https://app.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
============ =======================================================================


Changes since last version
--------------------------

* `7d96bdc`_: Add pip cache to gitignore

.. _7d96bdc: https://github.com/fiaas/logging/commit/7d96bdc

