본문으로 건너뛰기

에러 로그 처리기(ErrorProcessor) 도입 및 LogAndCrash 적재 포맷 개선

PHP 8 · GODO26
변경 파일 수: 3개
변경 파일 목록
3
변경 파일 코드
추가삭제
Component/Attendance/AttendanceCheckLogin.php+4
변경 전AttendanceCheckLogin.php
 
use Bundle\Component\Attendance\Exception\AttendanceValidationException;
use Bundle\Component\Attendance\Exception\AttendanceGlobalMallException;
 
use Component\Attendance\Attendance;
use Framework\Object\SimpleStorage;
 
$exceptionMessage = __METHOD__ . ', ' . $e->getFile() . '[' . $e->getLine() . '], ' . $e->getMessage();
$logger->warning($exceptionMessage, $e->getTrace());
throw $e;
 
 
 
} catch (\Exception $e) {
$exceptionMessage = __METHOD__ . ', ' . $e->getFile() . '[' . $e->getLine() . '], ' . $e->getMessage();
$logger->error($exceptionMessage, $e->getTrace());
 
변경 후AttendanceCheckLogin.php
 
use Bundle\Component\Attendance\Exception\AttendanceValidationException;
use Bundle\Component\Attendance\Exception\AttendanceGlobalMallException;
use Framework\Debug\Exception\NoticeException;
use Component\Attendance\Attendance;
use Framework\Object\SimpleStorage;
 
$exceptionMessage = __METHOD__ . ', ' . $e->getFile() . '[' . $e->getLine() . '], ' . $e->getMessage();
$logger->warning($exceptionMessage, $e->getTrace());
throw $e;
} catch (NoticeException $e) {
// 사용자 알림 예외는 error 적재 대상이 아님 — 아래 generic catch보다 먼저 rethrow
throw $e;
} catch (\Exception $e) {
$exceptionMessage = __METHOD__ . ', ' . $e->getFile() . '[' . $e->getLine() . '], ' . $e->getMessage();
$logger->error($exceptionMessage, $e->getTrace());
 
Component/Mail/MailMimeAuto.php+5-1
변경 전MailMimeAuto.php
}
} catch (Exception $e) {
$this->isAutoSend = false;
$this->logger->error($e->getMessage(), $e->getTrace());
 
 
 
 
}
$this->replaceData = $this->replaceCode->getReplaceCode();
$this->logger->info('Initialize end.');
 
변경 후MailMimeAuto.php
}
} catch (Exception $e) {
$this->isAutoSend = false;
if ($e->getCode() === 200) {
$this->logger->warning($e->getMessage(), $e->getTrace());
} else {
$this->logger->error($e->getMessage(), $e->getTrace());
}
}
$this->replaceData = $this->replaceCode->getReplaceCode();
$this->logger->info('Initialize end.');
 
Component/Mobile/MobileShop.php+2-2
변경 전MobileShop.php
if ($request->getQueryString()) {
$_tmp['retUrl'] = $_tmp['retUrl'] . '?' . $request->getQueryString();
}
$logger->alert(sprintf('%s, move index location[%s]', __METHOD__, $_tmp['retUrl']));
header('location:' . $_tmp['retUrl']);
exit();
}
if ($request->getQueryString()) {
$_tmp['retUrl'] = $_tmp['retUrl'] . '?' . $request->getQueryString();
}
$logger->alert(sprintf('%s, move mobile page location[%s]', __METHOD__, $_tmp['retUrl']));
header('location:' . $_tmp['retUrl']);
exit();
}
 
변경 후MobileShop.php
if ($request->getQueryString()) {
$_tmp['retUrl'] = $_tmp['retUrl'] . '?' . $request->getQueryString();
}
$logger->info(sprintf('%s, move index location[%s]', __METHOD__, $_tmp['retUrl']));
header('location:' . $_tmp['retUrl']);
exit();
}
if ($request->getQueryString()) {
$_tmp['retUrl'] = $_tmp['retUrl'] . '?' . $request->getQueryString();
}
$logger->info(sprintf('%s, move mobile page location[%s]', __METHOD__, $_tmp['retUrl']));
header('location:' . $_tmp['retUrl']);
exit();
}