serilog-contrib / Serilog.Sinks.Telegram.Alternative

Serilog.Sinks.Telegram.Alternative is a library to save logging information from Serilog to Telegram.
MIT License
36 stars 12 forks source link

appsettings.json minimunLevel not working. #3

Closed marce1994 closed 3 years ago

marce1994 commented 4 years ago

Sink minimumLevel not working (appsettings example):

{
    "Serilog": {
        "Using": [ "Serilog.Sinks.Telegram" ],
        "MinimumLevel": {
            "Default": "Warning"
        },
        "WriteTo": [
            {
                "Name": "Telegram",
                "Args": {
                    "botToken": "123151488:AAgshf4r373rffsdfOfsdzgfwezfzqwfr7zewE",
                    "chatId": "12345",
                    "minimumLevel": "Warning"
                }
            }
        ]
    }
}

I changed it to the following, and it worked

"Serilog": {
    "Using": [ "Serilog.Sinks.Telegram" ],
    "MinimumLevel": "Debug",
    "WriteTo": [
      {
        "Name": "Telegram",
        "Args": {
          "botToken": "123123123:dpioufdcbfoikjudfsfnifdugnfpiugnfdspiujhfd",
          "chatId": "123123",
          "restrictedToMinimumLevel": 2
        }
      }
    ]
  }
SeppPenner commented 3 years ago

Ok, I will check this. Sorry, I somehow don't get notified if someone adds issues in my projects...

marce1994 commented 3 years ago

Ok, no problem, it's an open-source project, let me know if you need some help.

Thx :)

SeppPenner commented 3 years ago

Ah, now I understand the issue, I guess, I have renamed this setting... I will add a hint to the documentation on this. (It's called restrictedToMinimumLevel now instead of minimumLevel).

SeppPenner commented 3 years ago

This is fixed with https://github.com/SeppPenner/Serilog.Sinks.Telegram/commit/7d2aea9fb7f2ad51f6f41efe29e8d9444faa7b65.