Ejemplo n.º 1
0
        public async Task Invoke(HttpContext context)
        {
            try
            {
                await _next(context);
            }
            catch (Exception e)
            {
                _logger.LogError($"Something went wrong: {e}");
                if (context.Response.HasStarted)
                {
                    _logger.LogWarning("The response has already started, the Exception Middleware will not be executed");
                    throw;
                }
                await HandleExceptionAsync(context, e);

                _kissLogger.Debug("Mensagem: " + e.Message + " Origem: " + e.Source);
            }
        }
Ejemplo n.º 2
0
 public IActionResult Index()
 {
     _logger.Trace("Usuário acessou a home!");
     _logger.Debug("Usuário acessou a home 2 !");
     return(View());
 }
 public IActionResult IndexKissLog()
 {
     _loggerKissLog.Debug("Ocorreu um erro aqui!");
     return(View());
 }