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

Args String Array Support. #296

Open
RiddlerKnight opened this issue Jan 7, 2022 · 1 comment
Open

Args String Array Support. #296

RiddlerKnight opened this issue Jan 7, 2022 · 1 comment

Comments

@RiddlerKnight
Copy link

I try to use string[] in Args section but the values is not map to the config option.

"WriteTo":[
     {
        "Name": "Elasticsearch",
        "Args": {
               "indexAliases": ["logstash"]
         }
     }
]

Serilog.Settings.Configuration 3.3.0

@0xced
Copy link
Member

0xced commented Mar 10, 2023

The Serilog.Sinks.Elasticsearch sink is configured through an ElasticsearchSinkOptions options parameter. So this is how it must be configured (i.e. with an intermediate options object):

"WriteTo": [
  {
    "Name": "Elasticsearch",
    "Args": {
      "options": {
        "indexAliases": [ "logstash" ]
      }
    }
  }
]

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

No branches or pull requests

3 participants