raisedapp / hangfire.jobslogger Goto Github PK
View Code? Open in Web Editor NEWA Hangfire extension to store a log during job execution.
Home Page: https://www.nuget.org/packages/Hangfire.JobsLogger
License: MIT License
A Hangfire extension to store a log during job execution.
Home Page: https://www.nuget.org/packages/Hangfire.JobsLogger
License: MIT License
It seems that this library is having the same behavior as the "Hangfire.Storage.SQLite.SQLiteMonitoringApi" where you are trying to access keys in the dictionary that are not present.
HEre is an example:
"error": {
"code": "ExceptionErrorCode",
"message": "The given key 'Queue' was not present in the dictionary.",
"target": "System.Collections.Generic.KeyNotFoundException",
"details": [
{
"code": "ExceptionStacktraceErrorCode",
"message": " at System.Collections.Generic.Dictionary2.get_Item(TKey key)\r\n at Hangfire.JobsLogger.Dashboard.EnqueuedStateRenderer.Render(HtmlHelper helper, IDictionary
2 stateData)\r\n at Hangfire.Dashboard.Pages.JobDetailsPage.Execute()\r\n at Hangfire.Dashboard.RazorPage.TransformText(String body)\r\n at Hangfire.Dashboard.RazorPageDispatcher.Dispatch(DashboardContext context)\r\n at Hangfire.Dashboard.AspNetCoreDashboardMiddleware.Invoke(HttpContext httpContext)\r\n at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.Invoke(HttpContext context)\r\n at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)\r\n at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)\r\n at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIIndexMiddleware.Invoke(HttpContext httpContext)\r\n at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext)\r\n at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.Invoke(HttpContext context)\r\n at Application.Core.AspNetCore.Errors.ErrorHandlerMiddleware.Invoke(HttpContext context, ILogger`1 logger, IHostingEnvironment env)",
"details": []
}
]
}
}
I'm using SeriLog to write logs to a file. So I added this library and append the
configuration.UseJobsLogger();
But no result is displayed in the log tab. I didn't understand if I can't continue to use a external provider like SeriLog and replace it by this or if this can work simultaneously and I'm doing something wrong.
Add the Logs menu and display the Logs messages that have been registered by the plugin.
After looking a the Example PNG files, I was able to determine that the JobLogger is embedded in the Dashboard "Jobs".
I had to drill down into the Jobs to find the details and logs.
THANK YOU for developing this! It will make my day easier.
RC
Hi, I am using .Net core and implement this plugin.
services.AddHangfire(config => { config.UseSqlServerStorage(Configuration.GetConnectionString("DefaultConnection")).UseJobsLogger(); config.UseMediatR(); });
This is my code in the Startup.cs
`private readonly ILogger _logger;
public TestLogging(ILogger logger)
{
_logger = logger
}
public void TestMethod()
{
context.LogInformation($"{i} - Information Message.. {DateTime.UtcNow.Ticks}");
}`
this is my code. The logging is empty.
Note: I using Nlog in this project
Is it possible to add a search in the log page in order to find log messages related to the search?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.