feat: API 요청/응답 로깅 시스템 추가

- api_request_logs 테이블 생성 (하루치만 보관)
- LogApiRequest 미들웨어로 DB + 로그 파일 이중 저장
- 날짜별 로그 파일: storage/logs/api/api-YYYY-MM-DD.log
- 민감 데이터 자동 마스킹 (password, token 등)
- api-log:prune 스케줄러로 매일 03:00 자동 정리
This commit is contained in:
2025-12-15 15:16:38 +09:00
parent 23fd59dc88
commit ba528b5a13
6 changed files with 316 additions and 0 deletions

View File

@@ -127,6 +127,23 @@
'path' => storage_path('logs/laravel.log'),
],
/*
|--------------------------------------------------------------------------
| API Request/Response 로그 채널
|--------------------------------------------------------------------------
|
| API 통신 전용 로그 채널. 날짜별로 파일 분리.
| 파일 경로: storage/logs/api/api-YYYY-MM-DD.log
|
*/
'api' => [
'driver' => 'daily',
'path' => storage_path('logs/api/api.log'),
'level' => 'info',
'days' => env('API_LOG_DAYS', 14),
'replace_placeholders' => true,
],
],
];