Code Monkey home page Code Monkey logo

dickinsonbros.logger's Introduction

DickinsonBros.Logger

Azure DevOps builds (branch) Azure DevOps coverage (branch) Azure DevOps releases

A logging service that redacts all logs

Features

  • Redacts all logs
  • Allows for dictionary of variables to be past in that all become first class propertys in the log.
  • Ability to add a correlation id that works though async in straight forward fashion
  • Allows for improved testability

Example Usage

var data = new Dictionary<string, object>
           {
               { "Username", "DemoUser" },
               { "Password",
@"{
""Password"": ""password""
}"
               }
           };

var message = "Generic Log Message";
var exception = new Exception("Error");

loggingService.LogDebugRedacted(message);
loggingService.LogDebugRedacted(message, data);

loggingService.LogInformationRedacted(message);
loggingService.LogInformationRedacted(message, data);

loggingService.LogWarningRedacted(message);
loggingService.LogWarningRedacted(message, data);

loggingService.LogErrorRedacted(message, exception);
loggingService.LogErrorRedacted(message, exception, data);
dbug: DickinsonBros.Logger.Runner.Program[1]
      Generic Log Message

dbug: DickinsonBros.Logger.Runner.Program[1]
      Generic Log Message
      Username: DemoUser
      Password: {
        "Password": "***REDACTED***"
      }

info: DickinsonBros.Logger.Runner.Program[1]
      Generic Log Message

info: DickinsonBros.Logger.Runner.Program[1]
      Generic Log Message
      Username: DemoUser
      Password: {
        "Password": "***REDACTED***"
      }

warn: DickinsonBros.Logger.Runner.Program[1]
      Generic Log Message

warn: DickinsonBros.Logger.Runner.Program[1]
      Generic Log Message
      Username: DemoUser
      Password: {
        "Password": "***REDACTED***"
      }

fail: DickinsonBros.Logger.Runner.Program[1]
      Generic Log Message

System.Exception: Error
fail: DickinsonBros.Logger.Runner.Program[1]
      Generic Log Message
      Username: DemoUser
      Password: {
        "Password": "***REDACTED***"
      }

Sample Runner

dickinsonbros.logger's People

Contributors

msdickinson avatar

Watchers

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