Code Monkey home page Code Monkey logo

logback-context-logbuffer's Introduction

Build Status Coverage Status Maven Central

logback-context-logbuffer

Logback plugin that allows to buffer logs messages until the loglevel of a log messages surpasses the set threshold

The problem

Logging is crucial for any system. It serves many purposes but one of the main purposes of general application logging is to help understand cases where something went wrong.

In the world of logging we use different levels of logging. Examples are DEBUG, INFO, WARN and ERROR. Each of them serves a purpose but in general the lower the level, the more information you will get.

It is a common struggle for developers and operations to determine what the log level should be. One the one hand you want to have DEBUG information available for the problem cases. However, on the other side you don't want the system to log everything on DEBUG level as results into enormous amounts of logs.

This tool provides a solution for this problem. Instead of of having to make the choice for a static log level, the logback-context-logbuffer will only print DEBUG logging in cases where something went wrong.

How it works

The logback-context-logbuffer works by creating an internal fifo-buffer of a configurable amount of log messages.

It will keep all log messages of all levels (as configured in logback.xml) in this buffer. As soon as it receives a log message of a certain level (typically WARN/ERROR) it will flush it's buffer to the appender.

Supported appenders

  1. ConsoleAppender
  2. RollingFileAppender

Other appenders are not yet supported. Please feel free to create a pull request.

Common pitfalls

  • You have set the log level to DEBUG in logback

For a working example see the examples directory.

References

logback-context-logbuffer's People

Contributors

sdegroot avatar

Watchers

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