I've configured Log4net with Hangfire and it's logging correctly to the root directory of my project.
Is it possible to show the logs in the Dashboard UI under the specific job that was executed?
I've configured Log4net with Hangfire and it's logging correctly to the root directory of my project.
Is it possible to show the logs in the Dashboard UI under the specific job that was executed?
This nuget package will allow you to add logs as you process the method. You can also show progress bar via the context. This is an extension to your existing Hangfire implementation. Be sure to add, 'using Hangfire.Console' in code where you are implementing the logs.
When you call the method, you basically provide null for the PerformContext
and Hangfire fills it with the correct context when executing it. Based on this context and the Hangfire.Console extension, you can update the job log with Hangfire.Console's WriteLine(string)
method.
Ref: Another thread that talks about how to use context.
© 2022 - 2024 — McMap. All rights reserved.