完善日志输出配置

This commit is contained in:
2025-03-05 10:20:02 +08:00
parent a1717ff0d1
commit ae7fcfe484
6 changed files with 54 additions and 20 deletions

View File

@@ -25,6 +25,7 @@ services:
environment:
APP_CTRL_PORT: $APP_CTRL_PORT
APP_DATA_PORT: $APP_DATA_PORT
APP_LOG_MODE: $APP_LOG_MODE
DB_HOST: $DB_HOST
DB_PORT: $DB_PORT
DB_DATABASE: $DB_DATABASE
@@ -50,7 +51,6 @@ services:
- "8686:8686"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /var/lib/docker/containers:/var/lib/docker/containers:ro
- /var/log/vector:/temp/vector
networks:
- proxy-server-test

View File

@@ -1,3 +1,5 @@
timezone = "Asia/Shanghai"
[api]
enabled = true
address = "0.0.0.0:8686"
@@ -11,6 +13,11 @@ inputs = ["docker"]
type = "remap"
source = '''
. = parse_json!(.message)
.time, err = format_timestamp(parse_timestamp!(.time, "%+"), "%Y-%m-%dT%H:%M:%S", "Asia/Shanghai")
if err != null {
log("Unable to parse JSON: " + err, level: "error")
abort
}
'''
# ===============