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

Passing object to WriteTo not working #316

Open
movsesiv opened this issue Jun 3, 2022 · 1 comment
Open

Passing object to WriteTo not working #316

movsesiv opened this issue Jun 3, 2022 · 1 comment

Comments

@movsesiv
Copy link

movsesiv commented Jun 3, 2022

I try to configure Serilog settings for different environemnts using appsettings.json. When I'm trying to use objects in "WriteTo", it doesn't work. I can use only array of strings.

  "Serilog": {
    "Using": [
      "AWS.Logger.SeriLog"
    ],
    "LogGroup": "staging-api",
    "Region": "us-east-1",
    "MinimumLevel": "Information",
    "Override": {
      "Elastic.Apm": "None",
      "Microsoft": "Warning",
      "System": "Warning"

    },
    "Enrich": [ "FromLogContext" ],
    "WriteTo": [
      "AWSSeriLog"
    ]
  }

This sample works.

  "Serilog": {
    "Using": [
      "AWS.Logger.SeriLog"
    ],
    "LogGroup": "staging-api",
    "Region": "us-east-1",
    "MinimumLevel": "Information",
    "Override": {
      "Elastic.Apm": "None",
      "Microsoft": "Warning",
      "System": "Warning"

    },
    "Enrich": [ "FromLogContext" ],
    "WriteTo": [
      { "Name": "AWSSeriLog" }
    ]
  }  

This one doesn't work. I need to use objects to pass "Args"

@sungam3r
Copy link
Contributor

You can add SelfLog.Enable(Console.Error) to debug issues during logging setup. Most probably this is some naming or file-not-found issue.

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

2 participants