GithubHelp home page GithubHelp logo

serilog-sinks-redis's Introduction

serilog-sinks-redis

I am a Serilog sink for Redis List

DEV MASTER BLEEDING NUGET
CI status Release Build status MyGet CI NuGet CI

Usage

Install-Package Serilog.Sinks.Redis.List

Log.Logger = new LoggerConfiguration()
            .WriteTo.RedisList("localhost:6379", "MyConsoleApp")
            .CreateLogger();

serilog-sinks-redis's People

Contributors

dburriss avatar henrikmerlander avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

serilog-sinks-redis's Issues

Configuration in appsettings.json Asp.net core 2.1

I am getting following exception:

System.TypeLoadException: 'Method 'get_IsConnecting' in type 'Serilog.Sinks.Redis.List.NoConnectionMultiplexer' from assembly 'Serilog.Sinks.Redis.List, Version=1.3.1.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.'

This is my code:
var logger = new LoggerConfiguration()
.WriteTo.RedisList("localhost:6379", "testKey")
.ReadFrom.Configuration(Configuration)
.CreateLogger();

I am using Serilog.Sinks.Redis.List version 1.3.1

Fail to run with stackexchange.redis > 2.0

Given I have latest StackExchange.Redis installed, Error is as follows :

Could not load file or assembly 'StackExchange.Redis, Version=1.1.608.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.

Please update the Redis package requirement to allow > 2.0 or provide alternate solution.

Writing logs to redis

Hello i have a ASP NET Core application where i am already using Serilog for logging to Console and also to a File.

I will also need to write some special logs to a Redis channel.
My question would be how can one choose which logs to write to a particular sink , in this case the Redis sink.

Impossible to set restrictedToMinimumLevel

The library gives no opportunity to change default value of restrictedToMinimumLevel parameter, thus not all messages are end up in the log.

Serilog default is Verbose. It would be nice to have this value configurable.

Release 2.0.0

We have proved the changes done via the pull request (a20f21d) are working, can you create an official release of this package? I think other can also benefit from it :)

Why LPUSH?

Hi,

Great work! Thank you.

I was wondering why you are using LPUSH instead of RPUSH.

Wouldn't this cause the newest events being processed before the older events?

Cheers.

Add support for passing abortOnFailConnect to ConnectionMultiplexer

As per This StackOverflow question on reconnecting to Redis there is a configuration parameter that enables automatic reconnect if Redis is down when you attempt to connect for the first time.

The current version appears to replace ConnectionMultiplexer with NoConnectionMultiplexer which never attempts to reconnect, meaning that if Redis comes back up at some point the logging won't resume until your application restarts.

Adding support for abortOnFailConnect parameter would enable this workflow without having to manually work around it in this library.

Unable to write Key to Redis.List - How to debug?

In our production netcore (v1.1.5 WebAPI + ReactJS) project, I'm unable to see the key we are using.

However in a sample netcore project (v1.1.5 WebAPI), it works fine.
Using redis-commander and docker we see:

redis-commander    | loading key ".NET Web Api" from "redis:6379:0"
redis-commander    | loading keys by prefix ""

In the our production project, we just see:

redis-commander    | loading keys by prefix ""
redis-commander    | found 1 keys for ""

In the controller I'm testing we're calling:

        string myKey = "netcore1";
        var log = new LoggerConfiguration()
            .WriteTo.Console(theme: AnsiConsoleTheme.Code)
            .WriteTo.RedisList("localhost:6379", myKey)
            .CreateLogger();`

And issuing requests from Postman to avoid working through the UI.

The production project is fairly large and tearing it down and testing seems pretty daunting.
Where would you suggest debugging the serilog.redis.list code?

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.