© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
2 replies
Sossenbinder

❔ Configuring loglevel of injected ILogger

I'm attempting to configure the loglevel of a custom ILogger<T> through configuration. Is this easily possible?

In my custom case I'm injecting an
ILogger<DataHandledLoggingHandler>
ILogger<DataHandledLoggingHandler>
into my class, and would like to disable it in certain environments. What I assumed should work is to add a key "DataHandledLoggingHandler" to the Logging.LogLevel section of appsettings.json, to e.g. "Error". However, I still see Warnings in my log sink. I've also attempted the fully qualified name, including namespace, but still no luck.

I do use Serilog with Seq and Console sink right now, but got it hooked up to ILogger through the
Serilog.Extensions.Logging
Serilog.Extensions.Logging
package.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ Configuring ILogger to log to database.
C#CC# / help
3y ago
ILogger question.
C#CC# / help
13mo ago
ILogger<T>
C#CC# / help
2y ago