Skip to content

Unable to specify a string array #98

Closed
@farzadmf

Description

@farzadmf

Hi,

I'm using Serilog.Sinks.AzureTableStorage package and more specifically, the WriteTo.AzureTableStorageWithProperties, which accepts a propertyColumns argument, which is of type string[].

No matter what I tried, I can't make it work so that I can pass an array of strings in my appsettings.json (or using the colon-separated syntax from my environment variables).

I tried doing something like this in appsettings.json:

WriteTo: [
  // ...
  {
    "Name": "AzureTableStorageWithProperties",
    "Args": {
      // ...
      "propertyColumns": [ "Column1", "Column2" ]
    }
  }
]

But I get an error saying that Argument value should be of type Action<>.

I tried this: "propertyColumns": "Column1, Column2", but this one also blows.

I also tried using environment variables, e.g.:

Serilog:WriteTo:2:Args:propertyColumns:0="Column1"
Serilog:WriteTo:2:Args:propertyColumns:1="Column2"

But, again no luck :(

So, is it possible somehow to specify a string array using this library? If so, what am I missing here?

I would really, really appreciate if you help me out here

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