I use MS SQL to storage Hangfire data and self-written logger to log all stuff from Hangfire on my Asp.net MVC 5 site. The problem is I can startup Hangfire, configure it, add new recurring job without any problems, but it just doesn’t work (failed state in Hangfire.Job table).
I use OwinStartup configuration:
public static void ConfigureHangfire(IAppBuilder app, string connectionName)
{
var options = new SqlServerStorageOptions
{
QueuePollInterval = TimeSpan.FromSeconds(10)
};
GlobalConfiguration.Configuration.UseSqlServerStorage(connectionName, options);
// Do not try to rerun failed jobs by default!
GlobalJobFilters.Filters.Add(new AutomaticRetryAttribute { Attempts = 0 });
// Add logs into passed log
LogProvider.SetCurrentLogProvider(new MyLogProvider()));
app.UseHangfireServer();
}
So I have 2 question:
- How can I make it work?
- Why do I not get any log error messages?