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

Unable to specify a string array #98

Closed
farzadmf opened this issue Apr 13, 2018 · 3 comments · Fixed by #100
Closed

Unable to specify a string array #98

farzadmf opened this issue Apr 13, 2018 · 3 comments · Fixed by #100

Comments

@farzadmf
Copy link

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

@farzadmf
Copy link
Author

Sorry if I'm asking a stupid question, but are these changes available in the NuGet package? Version 2.6.1 seems to be too old to contain these changes. Is it released as a pre-release version?

@nblumhardt
Copy link
Member

https://www.nuget.org/packages/Serilog.Settings.Configuration/3.0.0-dev-00103 is the one you're looking for 👍

@farzadmf
Copy link
Author

farzadmf commented May 1, 2018

Thank you @nblumhardt ; I'll check that out

@merbla merbla mentioned this issue May 15, 2018
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

Successfully merging a pull request may close this issue.

2 participants