Giter Site home page Giter Site logo

echopraxia-examples's Introduction

Echopraxia Examples

This project shows things you can do with Echopraxia, an application logging framework with structured logging, conditions, context, and filters. Echopraxia has Log4J2 and Logback implementations and is easy to extend with your own domain loggers and structure.

Async Logging

Scenario: you want to log conditionally, but you don't want to incur the costs of evaluating the condition in your rendering thread.

Solution: Use asynchronous logging, which will do all logging in another thread.

Demonstrates AsyncLogger with correct caller info. See README.

Diffing Objects

Scenario: you have a large object with lots of state, and you want to be able to "diff" the object so you can see only what changed in it.

Solution: Turn the object into a value using a field builder, and then diff the before and after against each other.

Demonstrates custom deserialization for fields and values using Jackson and zjsonpatch, a JSON patch library. See README.

Redis Condition Store

Scenario: you want to change logging dynamically, without restarting the application.

Solution: Use conditions and connect to a key/value backend like Redis to process scripts.

Demonstrates dynamic control of logging through Redis and Caffeine. See README.

JMX

Scenario: You want to turn debug logging on and off in an application for individual loggers running locally, from a GUI console.

Solution: Use JMX flags on conditions, and use JDK Mission Control to change boolean flags attached to loggers.

Demonstrates dynamic control of logging through JMX. See README.

Scripting

Scenario: you want dynamic targeted logging using conditions that test against specific arguments in your logging statements.

Solution: Use script conditions on the filesystem, and watch for changes in files.

Demonstrates use of Tweakflow scripts, and the ScriptWatchService. See README.

SQLite Condition Store

Scenario: You want scripts, but you're running in a production environment where centralized control over logging is important, and using Redis is overkill.

Solution: Keep the scripts in an SQLite database.

Demonstrates dynamic control of scripts kept in an SQLite database as a backing store. See README.

Timed Diagnostic

Scenario: You want to automatically turn up logging to DEBUG level for a while, when an error happens, so you can gather more diagnostic information.

Solution: Use a filter and a circuit breaker condition.

Demonstrates changing logging to diagnostic level (DEBUG/TRACE) for a set duration in response to error messages. See README.

Metrics

Scenario: You want to log some additional statements when a metric is exceeded.

Solution: Use a metric condition.

Demonstrates logging in response to unusual dropwizard metrics conditions. See README.

System Info

Scenario: You want to add some system information to every statement.

Solution: Use a filter and OSHI to add additional fields to logging context.

Demonstrates a filter to add CPU and memory system information fields to the logger context on every logger call, using OSHI. See README.

Custom Field Builder and Logger

Scenario: You want to log some complex domain objects as structured fields, along with custom logging statements.

Solution: Use custom field builders and loggers.

Demonstrates use of a custom field builder and fancy loggers. See README.

Custom Conditions

Scenario: You want to add a condition that doesn't depend on JSON Path.

Solution: Use the streaming API.

Demonstrates use of the streaming API to search through the context tree. See README.

echopraxia-examples's People

Contributors

wsargent avatar

Stargazers

Serge Simard avatar

Watchers

 avatar James Cloos avatar

Forkers

wsargent

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.