Closed erik-kallen closed 2 years ago
Appears that I managed to misread the documentation. If I add the ApplicationVersion property, it is sent as expected.
Sorry
Not a problem @erik-kallen. Apologies for missing your question. Indeed by default this SDK will attempt to get the version of the entry assembly, but in some frameworks it can't pick it up. To clarify, have you resorted to specifying the version manually via the ApplicationVersion data field? Feel free to send a code snippet of what you've done if you don't mind. If you're doing this by fetching the version of the entry assembly, then that would make me wonder why the SDK isn't picking that up by default.
We are using .net 5, and it did not manage to automatically get the version from the input assembly. What I ended up doing was
.UseSerilog((builder, config) =>
{
config.ReadFrom.Configuration(builder.Configuration)
.Enrich.WithProperty("ApplicationVersion", Assembly.GetExecutingAssembly().GetName().Version.ToString())
.Enrich.FromLogContext();
})
}
and that worked
Thanks for the additional details and code snippet, that's much appreciated. I've noted down to explore if this could be picked up automatically in .NET 5+ but don't have a time frame of when this could be done.
It could also be a good idea to amend the documentation with the information that post data will not be sent unless code like the following is added to the startup:
app.Use((context, next) =>
{
context.Request.EnableBuffering();
return next();
});
I have the following Serilog config:
This works, but the version is reported in the RayGun UI as "Not supplied". The documentation says that the assembly version of the entry assembly should be used by default, but this does not happen.