public IActionResult Error()
        {
            var exceptionHandlerPathFeature =
                HttpContext.Features.Get <IExceptionHandlerPathFeature>();

            NLogLogger nLogLogger = new NLogLogger();

            nLogLogger.LogWithNLog($"Hata :{exceptionHandlerPathFeature.Error.Message}\nHatanın Oluştuğu Yer:{exceptionHandlerPathFeature.Path}\nStack Trace:{exceptionHandlerPathFeature.Error.StackTrace}");

            return(View());
        }
Esempio n. 2
0
        public IActionResult Error()
        {
            var exceptionHandlerPathFeature =
                HttpContext.Features.Get <IExceptionHandlerPathFeature>();
            NLogLogger logger = new NLogLogger();

            logger.LogWithNLog($"Hatanın olduğu yer : {exceptionHandlerPathFeature.Path}\n " +
                               $"Hata mesajı :{exceptionHandlerPathFeature.Error.Message}" +
                               $"StackTrace: {exceptionHandlerPathFeature.Error.StackTrace}");
            ViewBag.Path    = exceptionHandlerPathFeature.Path;
            ViewBag.Message = exceptionHandlerPathFeature.Error.Message;
            return(View());
        }