serilog-contrib / serilog-sinks-slack

A simple (yet customizable) Slack logging sink for Serilog
MIT License
41 stars 27 forks source link

usage with Serilog.Settings.Configuration #15

Closed adnan-kamili closed 3 years ago

adnan-kamili commented 7 years ago

I tried using the sink using https://github.com/serilog/serilog-settings-configuration but it didn't work:

"Serilog": {
    "MinimumLevel": {
      "Default": "Debug",
      "Override": {
        "Microsoft": "Information",
        "System": "Information"
      }
    },
    "WriteTo": [
      {
        "Name": "Slack",
        "Args": {
          "WebHookUrl": "https://hooks.slack.com/services/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
        }
      }
    ]
  }
cilerler commented 6 years ago

Args are case sensitive. It is webhookUrl not WebHookUrl

    "Using": [
      "Serilog.Sinks.Slack"
    ],
    "WriteTo": [
      {
        "Name": "Slack",
        "Args": {
          "restrictedToMinimumLevel": "Information",
          "webhookUrl": "https://hooks.slack.com/services/???",
          "batchSizeLimit": 20,
          "customUsername": "MyApp",
          "customIcon": ":rotating_light:",
          "period": "00:00:10",
          "showDefaultAttachments": false,
          "showExceptionAttachments": true
        }
      }
    ]
TrapperHell commented 3 years ago

This issue seems to have been resolved. Closing.

mgibas commented 3 years ago

Damn, this project is alive :) GJ @TrapperHell !