Add structured logging and centralized error handling
- Initialize slog in the serve command with terminal/file support - Introduce `AppError` with HTTP status for unified service-layer errors - Replace ad-hoc `api.Error` calls with `api.RespondError` - Wrap internal errors with `model.NewInternalError` and add reference IDs - Add `RequestID` middleware and switch router from `gin.Default` to `gin.New`
This commit is contained in:
@@ -22,6 +22,11 @@ storage:
|
||||
# Max upload file size in bytes. 0 = unlimited
|
||||
max_upload_size: 104857600 # 100 MB
|
||||
|
||||
log:
|
||||
level: info # terminal: debug, info, warn, error
|
||||
file_path: "" # empty = no file logging
|
||||
file_level: debug # file: debug, info, warn, error
|
||||
|
||||
jwt:
|
||||
secret: change-me-in-production
|
||||
access_ttl: 15m
|
||||
|
||||
Reference in New Issue
Block a user