From 87e3a7418a4c56d055891e391edd8825035f948a Mon Sep 17 00:00:00 2001 From: DucDangAnh Date: Wed, 15 Jul 2020 16:02:34 +0700 Subject: [PATCH] ApiController - update appLogger log --- AIParkingApplication/ApiController.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/AIParkingApplication/ApiController.cs b/AIParkingApplication/ApiController.cs index 2469b08..55b7657 100644 --- a/AIParkingApplication/ApiController.cs +++ b/AIParkingApplication/ApiController.cs @@ -44,6 +44,7 @@ namespace AIParkingApplication catch (Exception ex) { Console.WriteLine($"Login Exception:\t{DateTime.Now.GetTimeFormatted()} \t {ex.Message}"); + appLogger.Log(LogLevel.Error, $"Login lỗi. exMessage: {ex.Message}"); return new LoginDataModel { IsLoginSuccess = false, @@ -74,7 +75,7 @@ namespace AIParkingApplication catch (Exception ex) { Console.WriteLine($"GetStatisticInfo Exception:\t{DateTime.Now.GetTimeFormatted()} \t {ex.Message}"); - appLogger.Log(LogLevel.Info, $"Query dữ liệu thống kê bãi xe lỗi. exMessage: {ex.Message}"); + appLogger.Log(LogLevel.Error, $"Query dữ liệu thống kê bãi xe lỗi. exMessage: {ex.Message}"); return null; } } @@ -104,12 +105,11 @@ namespace AIParkingApplication catch (Exception ex) { Console.WriteLine($"CheckCard Exception:\t{DateTime.Now.GetTimeFormatted()} \t {ex.Message}"); - appLogger.Log(LogLevel.Info, $"Query thông tin thẻ lỗi. Thẻ số: {cardNumber} | số lần thử lại: {requestCounter} | exMessage: {ex.Message}"); + appLogger.Log(LogLevel.Error, $"Query thông tin thẻ lỗi. Thẻ số: {cardNumber} | số lần thử lại: {requestCounter} | exMessage: {ex.Message}"); return null; } } - //Neu Dicrection la Out thi logID la logID lay ve khi check the public async Task SaveLog(LaneDirection direction, string cardID, string cameraID, PlateType plateType, string timestamp, string plateString, Mat plateImage, Mat plateImageResult, Mat plateFrameImage, Mat frameImage, string logID = "") { string plateImageBase64 = Convert.ToBase64String(plateImage.ToBytes()); @@ -149,7 +149,7 @@ namespace AIParkingApplication catch (Exception ex) { Console.WriteLine($"SaveLog Exception:\t{DateTime.Now.GetTimeFormatted()} \t {ex.Message}"); - appLogger.Log(LogLevel.Info, string.Format("Không thể lưu log gửi xe. Làn: {0} | Mã thẻ: {1} | cameraID: {2} | Thời gian: {3} | Biển số: {4} | LogID: {5} | exMessage: ", direction == LaneDirection.In ? "IN" : "OUT", cardID, cameraID, timestamp, plateString, logID, ex.Message)); + appLogger.Log(LogLevel.Error, string.Format("Không thể lưu log gửi xe. Làn: {0} | Mã thẻ: {1} | cameraID: {2} | Thời gian: {3} | Biển số: {4} | LogID: {5} | exMessage: ", direction == LaneDirection.In ? "IN" : "OUT", cardID, cameraID, timestamp, plateString, logID, ex.Message)); return null; } }