@extends('layouts.app') @section('title', 'API 로그 상세') @section('content')

API 로그 상세

@if($log->response_status >= 400) @endif

요청 정보

메서드
{{ $log->method }}
상태 코드
{{ $log->response_status }}
응답 시간
{{ number_format($log->duration_ms) }}ms
요청 시간
{{ $log->created_at->format('Y-m-d H:i:s') }}
URL
{{ $log->url }}
라우트
{{ $log->route_name ?? '-' }}
IP 주소
{{ $log->ip_address ?? '-' }}
테넌트
@if($log->tenant) {{ $log->tenant->company_name }} (#{{ $log->tenant_id }}) @else {{ $log->tenant_id ?? '-' }} @endif
사용자
@if($log->user) {{ $log->user->name ?? $log->user->email }} (#{{ $log->user_id }}) @else {{ $log->user_id ? "#{$log->user_id}" : 'guest' }} @endif
그룹 ID
@if($log->group_id) {{ Str::limit($log->group_id, 20) }} @else - @endif
@if($log->group_id && count($groupLogs) > 0)

같은 그룹의 요청

@foreach($groupMethodCounts as $method => $count) @php $methodColors = [ 'GET' => 'bg-blue-100 text-blue-800', 'POST' => 'bg-green-100 text-green-800', 'PUT' => 'bg-yellow-100 text-yellow-800', 'PATCH' => 'bg-orange-100 text-orange-800', 'DELETE' => 'bg-red-100 text-red-800', ]; $color = $methodColors[$method] ?? 'bg-gray-100 text-gray-800'; @endphp {{ $method }} {{ $count }} @endforeach 총 {{ count($groupLogs) }}개
@endif @if($log->user_agent)

User Agent

{{ $log->user_agent }}
@endif @if($log->request_headers)

요청 헤더

{!! stripslashes(json_encode($log->request_headers, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)) !!}
@endif @if($log->request_query && count($log->request_query) > 0)

쿼리 파라미터

{!! stripslashes(json_encode($log->request_query, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)) !!}
@endif @if($log->request_body && count($log->request_body) > 0)

요청 바디

{!! stripslashes(json_encode($log->request_body, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)) !!}
@endif @if($log->response_body)

응답 바디

@php $responseData = json_decode($log->response_body, true); // json_decode 실패 시 유니코드 이스케이프를 한글로 변환하고 슬래시 이스케이프도 제거 if ($responseData === null) { $displayBody = preg_replace_callback('/\\\\u([0-9a-fA-F]{4})/', function($m) { return mb_convert_encoding(pack('H*', $m[1]), 'UTF-8', 'UTF-16BE'); }, $log->response_body); $displayBody = str_replace('\\/', '/', $displayBody); } @endphp @if($responseData)
{!! stripslashes(json_encode($responseData, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)) !!}
@else
{!! e($displayBody) !!}
@endif
@endif @if($log->response_status >= 400) @endif @endsection