GithubHelp home page GithubHelp logo

cwlogger's Introduction

CWLogger

Simple handler for cloudwatch logging. Just found it helpful rather than re-writing a handler each time I need to create a log, since the boto3 logs client isn't the easiest thing to work with.

Usage

Requires boto3 to be installed and configured with read-write permissions to cloudwatch-logs.

If the log group is setup ahead of runtime, create-group permission is not needed.

import mylogger

log = mylogger.CWLog()
log.log("Text to log to cloudwatch-logs")

A specific log group can be specified:

log = mylogger.CWLog(logGroup='MyTestLogGroup/mylogs')

A specific log stream prefix can be specified:

log = mylogger.CWLog(logStreamName='MyStreamPrefix')

Creating a log in a different AWS region can be done:

log = mylogger.CWLog(region='ap-east-1')

The default values:

defaultLogGroup = 'MyCustomLogs/Logs'
defaultLogStream = 'LogStream'
region = 'us-east-1'

cwlogger's People

Contributors

adam133 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.