-
Notifications
You must be signed in to change notification settings - Fork 43
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
Opening exception details tries to parse the field as XML rather than string for MSSQL #130
Comments
Can you kindly provide me additional context? As you see, the property type is XML in the sample, thus the Provider you're using expect the data serialization as XML (I guess you're using the MSSQL Provider :D) Please let me know
Addendum: I'll also change the implementation to simply print out the string data, if code parsing fails 👍 |
Could this be the same confusion we had in #109 (comment) ? Startup.cs services.AddSerilogUi(options =>
{
options.UseSqlServer(c =>
{
c.WithConnectionString(_defaultConnectionString);
c.WithSchema("AppLog");
c.WithTable("WebApi");
c.WithCustomProviderName("Web");
});
options.UseSqlServer(c =>
{
c.WithConnectionString(_defaultConnectionString);
c.WithSchema("AppLog");
c.WithTable("AuthApi");
c.WithCustomProviderName("Auth");
});
options.UseSqlServer(c =>
{
c.WithConnectionString(_defaultConnectionString);
c.WithSchema("AppLog");
c.WithTable("Hangfire");
c.WithCustomProviderName("Hangfire");
});
options.AddScopedSyncAuthFilter<MyUiAuthorizationFilter>();
});
...
app.UseSerilogUi(options =>
{
options.WithHomeUrl(env.IsDevelopment() ? "http://localhost:4200" : "https://opg.systems");
options.InjectJavascript("/serilog-ui/custom.js", injectInHead: true);
options.WithAuthenticationType(AuthenticationType.Jwt);
}); Serilog config of one of the apps (there is a common appsettings.json file, hence the "Serilog": {
"Using:2": "Serilog.Sinks.MSSqlServer",
"WriteTo:2": {
"Name": "MSSqlServer",
"Args": {
"connectionString": "AppLogConnection",
"sinkOptionsSection": {
"tableName": "WebApi",
"schemaName": "AppLog",
"autoCreateSqlTable": true
}
}
},
"Filter": [
{
"Name": "ByExcluding",
"Args": {
"expression": "(RequestPath = '/api/maat' and (RequestMethod = 'POST' or RequestMethod = 'OPTIONS')) or RequestPath = '/api/health/ping' or StartsWith(RequestPath, '/swagger') or StartsWith(RequestPath, '/hangfire') or StartsWith(RequestPath, '/serilog-ui')"
}
}
]
} |
I think you're right - I'll give a try with the sample I made in the repo and try to understand how to improve this point :) (something related: https://github.com/serilog-mssql/serilog-sinks-mssqlserver?tab=readme-ov-file#properties) I'll notify you as soon as I have news! |
Released in v3.0.1. In the upcoming v3.1.0, Exception column rendering will be improved :) |
Will that be released momentarily or after a while? |
The feature is ready but I wanted to see if I can develop a second feature for v3.1, before releasing 😊 If you want to try it, I can create a v3.1 beta for UI and MSSQL provider - let me know if you want it and I'll do it later today 😁 |
If the release will be later than Monday please publish a beta package, else I don't mind waiting. It has to do with me doing daily checkups. |
gotcha, you have UI and MSSQL v3.1.0-beta.1 to test out 😉 feel free to share feedback about it! I prefer to take additional time for the stable release, 'cause I want to try to add the Log Database Id to the viewer in this release! |
@followynne thanks - this works great, thank you! Only nitpick i have is that the exception info is now very dark and hard to read; |
Thanks for the feedback! I still have the pr open, I'll change something 😁 |
I'm seeing the following issue when opening exception details;
This is odd, the 'exception' detail field should be a plain string.
Sample FetchLogs;
The text was updated successfully, but these errors were encountered: