HangfireIO / Hangfire

An easy way to perform background job processing in .NET and .NET Core applications. No Windows Service or separate process required
https://www.hangfire.io
Other
9.43k stars 1.7k forks source link

Add info of job name in the failed jobs logs #2454

Open lucas-clementei1 opened 1 month ago

lucas-clementei1 commented 1 month ago

Hello :)

I'd like to add some info about the Job name in the failed jobs logs : Something like this ⬇️

From :

                         _logger.ErrorException(
                        $"Failed to process the job '{context.BackgroundJob.Id}': an exception occurred.",
                        failedState.Exception);

To :

                        _logger.ErrorException(
                        $"Failed to process the job '{context.BackgroundJob.Job?.Type.Name}' with id '{context.BackgroundJob.Id}': an exception occurred.",
                        failedState.Exception);

Is it possible ? I have a branch already ready in local if you want, but I can't create a PR (I'm pretty new, feel free to tell me if it's not the correct way of asking :) )

Thank you in advance