Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't configure PeriodicBatching options with email sink #135

Open
SamWECA opened this issue Jun 21, 2024 · 2 comments
Open

Can't configure PeriodicBatching options with email sink #135

SamWECA opened this issue Jun 21, 2024 · 2 comments

Comments

@SamWECA
Copy link

SamWECA commented Jun 21, 2024

Tried to follow the structure outlined here: #130, but can't seem to get it to only send according to the config, which is below. This is using appsettings.json.

"Serilog": { "MinimumLevel": { "Default": "Debug", "Override": { "System": "Error", "Microsoft": "Error" } }, "WriteTo": [ { "Name": "EventLog", "Args": { "restrictedToMinimumLevel": "Error", "source": "redacted" } }, { "Name": "Email", "Args": { "options": { "from": "redacted", "to": "redacted", "host": "redacted", "port": 25, "subject": "Error" }, "batchingOptions": { "batchSizeLimit": 5, "period": "00:01:00" }, "restrictedToMinimumLevel": "Error" } } ], "Enrich": [ "FromLogContext" ] }

@bfnoling
Copy link

Make sure your To: email address is in an array, even if there is only one

    "WriteTo": [
      {
        "Name": "Email",
        "Args": {
          "options": {
            "from": "[email protected]",
            "to": [ "[email protected]" ],
            "host": "localhost"
          }
        }
      }
    ]

@alwilton
Copy link

Perahps this will help
.Net Core and Serilog Email sink - JSON Config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants