-
Notifications
You must be signed in to change notification settings - Fork 129
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
Support of constructor parameters #281
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just had one minor query; looks good to me. Seems like it would be wise for us to queue up a 3.3.0 release shortly after merging - the world needs this! :-D
awesome!!! |
I apologise given this is an old PR, but how do you pass a constructor argument using config? I am trying to pass the renderMessage:true argument to the inbuilt JsonFormatter, but cannot see given the example above how to do this (nor by reading the linked issue). If i try what seems indicated:
|
I've got the same or a simmilar problem as @WattsC-90 This is in my appsettings.json
And this is the exception
|
@wertzui @skomis-mm |
I know this is a late reply, but I got it working with the following code. The difference is including "Serilog" in the type which I'm assuming is the name of the Nuget Pacakge? "WriteTo": [
{
"Name": "Console",
"Args": {
"formatter": {
"type": "Serilog.Formatting.Json.JsonFormatter, Serilog",
"renderMessage": true
}
}
}
] |
Added support for constructor parameters (implementation of second design) including nested configurations and type binding that StringArgumentValue supports.
$
fortype
is optional to go in line with level/filter swithes declaration syntaxCtor
overload matching follows the same algorithm that is used in configuration method matching