public async Task InvokeAsync(HttpContext context) { await _next(context); var routeData = context.GetRouteData(); if (routeData.Values["action"] != null) { ControllerMessage msg = new ControllerMessage ( dateTime: DateTime.Now, ip: context.Connection.RemoteIpAddress.ToString(), service: Assembly.GetExecutingAssembly().GetName().Name, route: context.Request.Path.ToString(), controller: routeData.Values["controller"].ToString(), action: routeData.Values["action"].ToString(), identity: context.User.Identity.Name ?? "Unidentified", status: context.Response.StatusCode ); await _kafkaLogger.WriteLogAsync(); } }
public void LogManagerLogin(int id, string email, string role) { _ = _logger.WriteLogAsync(MANAGER_LOGIN, DateTime.Now.ToString("s"), id.ToString(), email, role); }