fix : 로그, 알람 설정 수정
This commit is contained in:
@@ -10,7 +10,10 @@ class Handler extends ExceptionHandler
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -25,7 +28,7 @@ protected function sendSlackException(Throwable $e): void
|
||||
if (!$url) return;
|
||||
|
||||
Http::post($url, [
|
||||
'text' => "*🚨 Laravel 예외 발생!*\n" .
|
||||
'text' => "*🚨[".env('APP_ENV')."] Laravel 예외 발생!*\n" .
|
||||
"• 메시지: `{$e->getMessage()}`\n" .
|
||||
"• 위치: `{$e->getFile()}:{$e->getLine()}`\n" .
|
||||
"• 시간: " . now()->toDateTimeString()
|
||||
|
||||
@@ -34,24 +34,6 @@ public function handle(Request $request, Closure $next)
|
||||
->where('key', $apiKey)
|
||||
->where('is_active', true)
|
||||
->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) {
|
||||
@@ -76,7 +58,7 @@ public function handle(Request $request, Closure $next)
|
||||
Log::info('API Response', [
|
||||
'uri' => $request->getRequestUri(),
|
||||
'status' => $response->getStatusCode(),
|
||||
// 'content' => $response->getContent(), // 응답 body도 원하면!
|
||||
'content' => $response->getContent(), // 응답 body도 원하면!
|
||||
]);
|
||||
|
||||
return $response;
|
||||
|
||||
Reference in New Issue
Block a user