Log Custom Messages To The Job History Page

In this topic (Added logging support to Hangfire ) some default log messages are written in to the history page. What I want is to log custom messages like that.

As an example, I’m doing a Fire-and-Forget method invocation like this.

BackgroundJob.Enqueue(() => SendEmail(name));

I want to log(write) custom messages to current job’s history page inside the SendEmail method.

Is there a way to do this?

Have you looked at this project? https://github.com/pieceofsummer/Hangfire.Console

3 Likes

Is there any way other than using Hangfire.Console ??

Just saw this:
meriturva/Hangfire.Dashboard.JobLogs: Show jobs log messages on hangfire dashboard (github.com)