Log4Slack use within Hangfire

I Currently have Hangfire set up for monitoring application services but would like to set up the logger use Log4Slack. I wasn’t sure if anyone else has had similar approaches to extend Hangfire in this manner. I tried to attempt to log Failures by using “Job Filters” but ran into an issue with the following line:

private static readonly Ilog Logger = LogManager.GetCurrentClassLogger();

within the Example provided for working with Job Filters
and do not know exactly why I cannot resolve symbol “GetCurrentClassLoger()” after adding and configuring the package via nuget for a ASP.NET MVC Application.

(Side Note: is there another way to have information that is shown within the Dashboard UI sent/pipelined to a WebApi Controller?)

Have you trying to implement custom log provider as shown here?

@odinserj
I did attempt creating a custom logger and found the textBufferLoger in the sample to work just fine. However I found that the method call used in the examples private static readonly Ilog Logger = LogManager.GetCurrentClassLogger(); particularly LogManager. GetCurrentClassLoger() within WebGrease seems to be deprecated and results with an error within Intillesene that this Method is not known.
[SOLUTION]
The Solution was to use LogProvider to gain Access to “GetCurrentClassLogger()”

[EXTRAS]
`I did accomplish using WebApiControllers and also connection for Log4Slack. I plan on creating a sample project to demonstrate this. Would it possible for you to add itto Samples for Hangfire? If not I can post a walk-though with a link to the project via github.

1 Like

It is interesting to me, where did you find information about LogManager.GetCurrentClassLogger (old log manager)?

I will be glad to see the first topic under tutorial category on this forum regarding to WebApiControllers + Log4Slack! This will be really nice! :heart: