You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using similar setup to manage the routes as in TodoApi.cs with RouteGroupBuilder, I think it works great. But haven't really figured out how to handle logging in there (as its static). Anyone got any tips ? We use a kind of ugly solution like this:
public static class AudienceEndpoints
{
// the LoggerFactory.Create part is all done just to initialize the ILogger, we overwrite it with the app one as we have to for now.
private static ILogger Logger = LoggerFactory.Create(builder => builder.AddApplicationInsights()).CreateLogger(typeof(AudienceEndpoints));
public static RouteGroupBuilder MapAudienceEndpoints(this IEndpointRouteBuilder routes, ILogger logger)
{
Logger = logger;
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Using similar setup to manage the routes as in TodoApi.cs with RouteGroupBuilder, I think it works great. But haven't really figured out how to handle logging in there (as its static). Anyone got any tips ? We use a kind of ugly solution like this:
where we initiate it from program.cs:
app.MapAudienceEndpoints(app.Logger);
Beta Was this translation helpful? Give feedback.
All reactions