Steeltoe.Extensions.Logging.SerilogDynamicLogger not working as expected
See original GitHub issueDescribe the bug
I have a .net core 2.2 application which is deployed in PCF 2.4.12. Configured Serilog and enabled dynamic console to adjust the log levels without restarting the application. But unfortunately the number of loggers appearing PCF Apps Manager is just 1. Upon adjusting the levels, there is no effect.
Steps to reproduce
Steps to reproduce the behavior:
- Deploy https://github.com/SteeltoeOSS/Samples/tree/master/Management/src/AspDotNetCore/CloudFoundry after integrating Serilog.
- Configure Serilog dynamic console like below
public static void Main(string[] args)
{
var host = new WebHostBuilder()
.UseKestrel()
.UseCloudFoundryHosting()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseStartup<Startup>()
.ConfigureAppConfiguration((builderContext, config) =>
{
config.SetBasePath(builderContext.HostingEnvironment.ContentRootPath)
.AddCommandLine(args)
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
.AddJsonFile($"appsettings.{builderContext.HostingEnvironment.EnvironmentName}.json", optional: true)
.AddCloudFoundry()
.AddEnvironmentVariables();
})
.UseSerilog((hostingContext, loggerConfiguration) => loggerConfiguration
.ReadFrom.Configuration(hostingContext.Configuration)
.WriteTo.Trace())
.ConfigureLogging((builderContext, loggingBuilder) =>
{
loggingBuilder.AddConfiguration(builderContext.Configuration.GetSection("Logging"));
loggingBuilder.AddDebug();
// Add Serilog Dynamic Logger
loggingBuilder.AddSerilogDynamicConsole();
})
.Build();
host.RunWithTasks();
Expected behavior
Number of loggers appearing in PCF Apps Manager should be matching the typed ILogger<T> used in the application and upon the adjusting the log levels, log statements should appear accordingly.
Environment (please complete the following information):
- Platform: PCF 2.4.12
- OS: Linux
- .NET Version : .net core 2.2
- Steeltoe Version: 2.3.0
- Any other library versions to note
Issue Analytics
- State:
- Created 4 years ago
- Comments:25 (13 by maintainers)
Top Results From Across the Web
Steeltoe.Extensions.Logging.SerilogDynamicLogger not ...
Describe the bug I have a .net core 2.2 application which is deployed in PCF 2.4.12. Configured Serilog and enabled dynamic console to ......
Read more >Steeltoe dynamic logging configuration with Serilog(or any ...
1 Answer 1 ... Steeltoe now has preliminary support for Serilog via the Steeltoe.Extensions.Logging.SerilogDynamicLogger , available in the dev ...
Read more >Serilog Dynamic Logger
Serilog Dynamic Logger. This logging provider extends the dynamic logging provider with Serilog. This allows logger levels configured via Serilog to be ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ani00763 yes, I can confirm this sample is having that issue both locally and on cf. let me investigate and get back.