fix : 로그, 알람 설정 수정

This commit is contained in:
2025-07-25 09:12:53 +09:00
parent 19839323ae
commit 181f1b258f
2 changed files with 6 additions and 21 deletions

View File

@@ -10,7 +10,10 @@ class Handler extends ExceptionHandler
{ {
public function report(Throwable $e): void public function report(Throwable $e): void
{ {
if (app()->environment('local') || app()->environment('production')) { if (
app()->environment('local') || app()->environment('production')
|| app()->environment('LOCAL') || app()->environment('DEV')
) {
$this->sendSlackException($e); $this->sendSlackException($e);
} }
@@ -25,7 +28,7 @@ protected function sendSlackException(Throwable $e): void
if (!$url) return; if (!$url) return;
Http::post($url, [ Http::post($url, [
'text' => "*🚨 Laravel 예외 발생!*\n" . 'text' => "*🚨[".env('APP_ENV')."] Laravel 예외 발생!*\n" .
"• 메시지: `{$e->getMessage()}`\n" . "• 메시지: `{$e->getMessage()}`\n" .
"• 위치: `{$e->getFile()}:{$e->getLine()}`\n" . "• 위치: `{$e->getFile()}:{$e->getLine()}`\n" .
"• 시간: " . now()->toDateTimeString() "• 시간: " . now()->toDateTimeString()

View File

@@ -34,24 +34,6 @@ public function handle(Request $request, Closure $next)
->where('key', $apiKey) ->where('key', $apiKey)
->where('is_active', true) ->where('is_active', true)
->exists(); ->exists();
// 2. 회원 인증 (remember_token으로)
if (!$validApiKey) {
$user = Member::where('remember_token', $apiKey)->first();
if ($user) {
$validApiKey = true;
// ✅ 세션에 유저 정보 저장
session(['Adm' => [
'idx' => $user->mb_num,
'id' => $user->mb_id,
'name' => $user->mb_name,
'level' => $user->mb_level,
'token' => $user->remember_token,
]]);
}
}
} }
if (!$validApiKey) { if (!$validApiKey) {
@@ -76,7 +58,7 @@ public function handle(Request $request, Closure $next)
Log::info('API Response', [ Log::info('API Response', [
'uri' => $request->getRequestUri(), 'uri' => $request->getRequestUri(),
'status' => $response->getStatusCode(), 'status' => $response->getStatusCode(),
// 'content' => $response->getContent(), // 응답 body도 원하면! 'content' => $response->getContent(), // 응답 body도 원하면!
]); ]);
return $response; return $response;