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

Add default constructor for CustomField #159

Open
sfkoch opened this issue May 12, 2022 · 0 comments
Open

Add default constructor for CustomField #159

sfkoch opened this issue May 12, 2022 · 0 comments

Comments

@sfkoch
Copy link

sfkoch commented May 12, 2022

I've been trying to configure Serilog.Sinks.Splunk.EventCollectorSink from appsettings.json, but can't get it to construct the CustomFields object. Among other things, I tried structuring "fields" for ConfigurationBinding.Get. That failed because CustomField doesn't have a default constructor.

Please add a default constructor on CustomField so that it can be deserialized from JSON like this:

        "fields": {
          "CustomFieldList": [
            {
              "Name": "name1",
              "ValueList": [ "value1" ]
            },
            {
              "Name": "name2",
              "ValueList": [ "value2" ]
            },
            {
              "Name": "name3",
              "ValueList": [ "value3" ]
            }
          ]
        }
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

1 participant