Closed Scopla closed 1 month ago
@Scopla the structure from the sample should be the correct one. You could try an older version of the package and find out in which version the structure changed.
@Scopla Is there something I can help you with, or can I close the issue?
Hi,
thanks for the answer.
I tested a little bit more and found out that it works if I use the dev branch of https://github.com/serilog/serilog-settings-configuration.
If I use the main branch I have the problems. I can share an example next week when I am back home.
@Scopla Did you have a chance to create a repo?
Hi,
yes I had time today: Link to Repo
I hope the readme is enough explanation, if not I will extend it. Basically this formatter is used when using the main branch of Serilog.Settings.Configuration. With the dev branch it uses the JsonFormatter specified in the appsettings.
@Scopla, Do I understand correctly that you're saying that the sink is not configured correctly when using main branch of Serilog.Settings.Configuration
, but is when using the dev branch?
Yes, exactly. And it seems to affect only the text formatter in this case. The primitive types work fine.
Then I assume this is an issue of Serilog.Settings.Configuration
which has been fixed already. Or do you suspect an issue in this repo?
I think this is the fix: https://github.com/serilog/serilog-settings-configuration/pull/430
I can confirm that this was indeed the fix for this issue.
This version fixes the issue: https://www.nuget.org/packages/Serilog.Settings.Configuration/8.0.2-dev-00599. 8.0.2-dev-00598
doesn't set the complex objects correctly.
Yes, that what i figured out a long the way when investigating the issue. Sorry for not communicating that clearly enough with the previous posts that I already learned that the issue is in the configuration package.
Thanks for the help!
@Scopla, Serilog.Settings.Configuration version 8.0.3 has been released, which includes the fix for adding nested complex types to the appsettings.
Hello,
It seems that with the current version of Serilog and the configuration of an alternative text formatter seems to work differently than in the past. I am not sure if I am doing something wrong and something changed over time or if this may be an unintended bug.
In the past I was used to configure the logger in the app settings json like in this example:
The batchPostingLimit and the queueLimit are set correctly but the textFormatter stays at the default one.
Changing the formatter only works if I am using this format:
I tested it with the Net8AppsettingsJsonSample in the repository.
Am I doing something wrong?