Skip to content

Add default constructor for CustomField #159

@sfkoch

Description

@sfkoch

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" ]
            }
          ]
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions