GithubHelp home page GithubHelp logo

hkaizzer / nlog.redis Goto Github PK

View Code? Open in Web Editor NEW

This project forked from richclement/nlog.redis

0.0 0.0 0.0 875 KB

Redis target for the NLog framework.

License: MIT License

C# 99.51% Batchfile 0.49%

nlog.redis's Introduction

Build status

NLog.Redis

This project provides a custom target for the NLog framework to allow a user to send log messages to a Redis server. The target supports sending log messages to a Redis list or to a pub/sub channel.

Installation

NLog.Redis is available as a NuGet Package. Type the following command into the Nuget Package Manager Console window to install it:

Install-Package NLog.Redis

Usage

The <target /> configuration section contains five required fields and one optional field.

  • host (required): The host name or IP Address of the Redis server.
  • port (required): The port the Redis server is listening on.
  • key (required): The key that should be used to identify the Redis list or the pub/sub channel to which the log messages are being delivered.
  • dataType (required): The Redis data type that should be used to store the log messages. This can be either list or channel.
  • layout (required): The layout that defines the format of the message to be sent to the Redis target.
  • db (optional): The Redis database id to store the log messages in, if the Redis database type list is chosen.

Config File

<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" throwExceptions="true">
  <extensions>
    <add assembly="NLog.Redis" />
  </extensions>
  <targets>
    <target xsi:type="Redis" name="redis" host="127.0.0.1" port="3679" db="0" 
            key="logKey" dataType="list" 
            layout="${date:format=yyyyMMddHHmmss} ${uppercase:${level}} ${message}" />
  </targets>
  <rules>
    <logger name="*" minlevel="Info" writeTo="redis" />
  </rules>
</nlog>

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.