Update logger configuration for development environment, enhancing logging structure with zap and lumberjack settings. Refactor logging utility to improve configuration file handling and add error management. Modify integration tests to utilize the new logger setup and adjust test payloads for consistency.

This commit is contained in:
windyboy
2025-11-15 17:42:10 +08:00
parent 53208997e8
commit dccff366d2
3 changed files with 85 additions and 13 deletions
+33
View File
@@ -1,3 +1,36 @@
{
"zapConfig": {
"level": "info",
"development": true,
"encoding": "json",
"encoderConfig": {
"messageKey": "msg",
"levelKey": "level",
"timeKey": "ts",
"nameKey": "logger",
"callerKey": "caller",
"stacktraceKey": "stacktrace",
"lineEnding": "",
"levelEncoder": "lowercase",
"timeEncoder": "iso8601",
"durationEncoder": "string",
"callerEncoder": "short"
},
"outputPaths": [
"stdout"
],
"errorOutputPaths": [
"stderr"
]
},
"lumberjackConfig": {
"filename": "./logs/caatsm-dev.log",
"maxSize": 50,
"maxBackups": 5,
"maxAge": 14,
"compress": false
}
}
{
"zapConfig": {
"level": "debug",