Closed rocknet closed 5 years ago
Apologies for the late reply. I would be happy to accept a pull request from you to fix this issue.
Hi @mperdeck we are also considering using JSNLog.Serilog but require this issue resolved before we can move forward. Please see my PR.
@mperdeck Hi, can you please make a working sample for Asp .Net Core 2.2 - Serilog - JSNlog?
@Shadowman4205 ASP.NET Core has its own logging infrastructure in which logging packages such as Serilog can be plugged (similar to Common.Logging). JSNLog simply talks to that infrastructure. Serilog has good support for ASP.NET Core. If you google this, you should be able to plug Serilog into the ASP.NET Core logging infrastructure.
Hi. I'm working on an upgrade from JSNLog.Log4Net to JSNLog.Serilog as part of a larger migration to structured logging. Previously, we set our server side logger name to ClientSideJS, we currently don't get that as expected in the Serilog SourceContext property.
I did enough investigation to know that it's because Common.Logging.Serilog.StructuredText was forked and not kept up to date. The initial commit here used
ForContext("name", name)
, but over the years the upstream has been properly updated to use the SourceContext property.I'm not sure why you needed to fork this rather than just adding a NuGet dependency, but assuming there's a need for that fork - and keeping it where it is - would you accept a PR to change
"name"
to"SourceContext"
in SerilogFactoryAdapter? If not, do you have any other suggestions? The JSNLog.Serilog package depends on this package, so it'd be a maintenance headache to not use it somehow.Reference: https://github.com/serilog/serilog/wiki/Writing-Log-Events#source-contexts