Giter Site home page Giter Site logo

giqlogging's Introduction

GIQLogging

https://travis-ci.org/graphiq-data/GIQLogging.svg?branch=master

GIQLogging is a lightweight logging initializer to promote standardized log formats across services. It wraps the functionality of logging with formatting provided by Exoscale's python-logstash-formatter.

import GIQLogging
logging = GIQLogging.init(logstash_type='servicename',
                          level=GIQLogging.INFO,
                          logpath='/path/to/log/output',
                          logger_name='servicename',
                          extra_fields={'foo': 'bar', 'hello': 'world'})
logging.info('log message')

Installation

To install GIQLogging, simply:

pip install GIQLogging

Assumptions

  • In Graphiq's case, GIQLogging is specifically intended for services to log JSON output to be picked up and visualized using an ELK (Elasticsearch, Logstash & Kibana) stack. As such, we require the logstash_type value to be set upon initialization. This value is placed as an extra_field and output to each log entry for later use by Logstash.
  • The default level if one is not provided is logging.DEBUG
  • If a logpath is not provided the log will be directed to sys.stdout
  • logger_name is optional, only necessary if initializing multiple loggers
  • extra_fields are optional

Issues

Please submit issues here.

giqlogging's People

Contributors

jadametz avatar

Watchers

 avatar  avatar

Forkers

python3pkg

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.