Skip to content
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

.NET Core 6 demo #58

Open
mtinnes opened this issue Dec 18, 2021 · 0 comments
Open

.NET Core 6 demo #58

mtinnes opened this issue Dec 18, 2021 · 0 comments

Comments

@mtinnes
Copy link

mtinnes commented Dec 18, 2021

Can we get a demo on using the new .NET 6 program.cs structure with Jsnlog? I'm using the following code, but does not seem to work, getting 404 on the /jsnlog.logger endpoint.

var app = builder.Build();

var logger = app.Logger;
var lifetime = app.Lifetime;

lifetime.ApplicationStarted.Register(() =>
{
    var factory = app.Services.GetRequiredService<ILoggerFactory>();
    app.UseJSNLog(new LoggingAdapter(factory));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant