serilog-settings-configuration | A Serilog configuration provider | Configuration Management library
kandi X-RAY | serilog-settings-configuration Summary
kandi X-RAY | serilog-settings-configuration Summary
A Serilog configuration provider that reads from Microsoft.Extensions.Configuration
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of serilog-settings-configuration
serilog-settings-configuration Key Features
serilog-settings-configuration Examples and Code Snippets
Community Discussions
Trending Discussions on serilog-settings-configuration
QUESTION
I am getting really strange behaviour trying to configure Serilog using appsettings.json.
It only works when I add Serilog.Settings.Configuration to my project using Add Project Reference. When Serilog.Settings.Configuration (3.2.0) is installed as package I am getting Exception:
...ANSWER
Answered 2021-Oct-11 at 15:25Update 2021-10-11: v3.3.0 has been released and includes the feature you're trying to use (Support of constructor parameters).
The feature you're trying to use (Support of constructor parameters) has not yet been released and as such is not present in the Serilog.Settings.Configuration
3.2.0
package which is why you get that error... This feature is planned to be released with 3.3.0
at date TBD.
You alternatives are:
1.) Use a pre-release package (e.g. 3.3.0-dev-00291
)
QUESTION
I can't connect the custom sink to the logger via the configuration file. I tried under .Net 5 and .Net Core 3.1.
I studied the documentation: https://github.com/serilog/serilog-settings-configuration#using-section-and-auto-discovery-of-configuration-assemblies
I also saw responses to an identical request. https://stackoverflow.com/a/50118486/13151982 https://stackoverflow.com/a/24922105/13151982
But for some reason, this does not work for me.
To reproduce the problem, I made a minimalistic application. Also does not work, as in my main project.
SampleApp.csproj:
...ANSWER
Answered 2021-Aug-23 at 13:09The Serilog configuration extension doesn't create instances of the sinks directly. All it does is to try to call a method .WriteTo.NameOfTheSinkYouDefinedInTheConfig()
, if that exists - so for that to work, you need to provide this method yourself.
If you look at the source code of any of the official sinks, you'll notice that they are always declared as internal
classes rather than public
classes, and the way to hook sinks into the Serilog configuration is by creating an extension method to the LoggerSinkConfiguration
class where you instantiate the sink yourself and add it to the pipeline.
In your case, it would be something like this:
QUESTION
I have an app that configures Serilog via appsettings.json file, i develop the app on windows but it is deployed to linux. How can i write logs to a relative directory Logs/logfile.log?
Is just changing the appsettings.json at deployment folder a good option?
right now this is the config i am using:
...ANSWER
Answered 2020-May-18 at 21:07What you can do is the following:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install serilog-settings-configuration
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page