Skip to content

Support serilog-settings-configuration #283

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

Open
southernprogrammer opened this issue Apr 17, 2025 · 3 comments
Open

Support serilog-settings-configuration #283

southernprogrammer opened this issue Apr 17, 2025 · 3 comments
Assignees

Comments

@southernprogrammer
Copy link

I'm not sure if you've looked into it yet, but it would be nice if this formatter supported having the formatter specified in appsettings.json by utilizing the following project: https://github.com/serilog/serilog-settings-configuration

@0xced
Copy link
Contributor

0xced commented Apr 19, 2025

Actually, Serilog.Formatting.Log4Net already supports the Serilog.Settings.Configuration package. It's even mentioned in the README. 😉

But if you mean configuring the formatter itself (i.e. indentation settings, CDATA mode etc.) then that's not supported simply because it's not how Serilog.Settings.Configuration works.

Does that answer your question?

@southernprogrammer
Copy link
Author

Yes, from my understanding it's possible to include some settings if your constructor had the option to take in a standard object instead of a builder (maybe just needing an overload).

@0xced
Copy link
Contributor

0xced commented Apr 30, 2025

You're right. Even though I worked on Serilog.Settings.Configuration I did not remember that this was indeed possible!

It's documented in the Complex parameter value binding section of the README. A formatter can be instantiated by specifying a type and its arguments.

I will consider this for a future release.

@0xced 0xced self-assigned this Apr 30, 2025
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

No branches or pull requests

2 participants