-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AspNetCore - Logging and parameters #1023
Comments
I would also add that it would be good if the SerilogLogProvider could be enhanced to specify additional properties that are used by the Serilog logger instance used by Hangfire; e.g. I would like to add a Component = 'Hangfire' key-value pair to all messages being logged by Hangfire so I can easily distinguish them from other components in my application. |
Another thing to add... NLog also supports structured logging. Also the LibLog logging API wrapper is structured logging aware. |
+1 for this feature |
I don't know how feasible it is to remove LibLog altogether, but for the record: LibLog is deprecated and the author recommends migrating to |
I am using the popular
serilog
logging library which is a structured logger.At the moment, when an exception occurs in a job, the message being logged looks like a simple formatted string e.g:
Failed to process the job '93364': an exception occurred.
This correlates with a log statement that looks as follows:
Because this logs a simple string which is always unique per log event, it means it doesn't work well with structured logging providers such as serilog. Please can it be changed to log similar to the following:
This allows the hashcode of the message template to remain constant each time an event is logged (which becomes important if using serilog in conjunction with something like seq) and allows any structured log provider to capture the value of the job id as a parameter which is useful when you want to filter or query those logs later by particular job ids.
The text was updated successfully, but these errors were encountered: