Skip to content

Commit 4e9dec7

Browse files
committed
Update Caddyfile logging configuration and modify supervisord commands to include environment variable
- Removed the 'svc' field from the JSON logging format in the Caddyfile for cleaner log output. - Updated supervisord configuration files for MongoDB, PostgreSQL, and SQLite to set an environment variable 'SVC' and modified the command to include this variable in the logging output, enhancing log context.
1 parent b821e67 commit 4e9dec7

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

Caddyfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
format json {
3838
time_format iso8601
3939
message_key msg
40-
field svc peekaping
4140
}
4241
level info
4342
timestamp true

supervisord.bundle.mongo.conf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ startsecs=10
9797
startretries=3
9898

9999
[program:caddy]
100-
command=caddy run --config /etc/caddy/Caddyfile
100+
environment=SVC="peekaping"
101+
command=/bin/sh -c 'caddy run --config /etc/caddy/Caddyfile | jq --arg svc "$SVC" ". + {svc: \$svc}"'
101102
autostart=true
102103
autorestart=true
103104
user=root

supervisord.bundle.postgres.conf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ startsecs=10
9797
startretries=3
9898

9999
[program:caddy]
100-
command=caddy run --config /etc/caddy/Caddyfile
100+
environment=SVC="peekaping"
101+
command=/bin/sh -c 'caddy run --config /etc/caddy/Caddyfile | jq --arg svc "$SVC" ". + {svc: \$svc}"'
101102
autostart=true
102103
autorestart=true
103104
user=root

supervisord.bundle.sqlite.conf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ startsecs=10
8080
startretries=3
8181

8282
[program:caddy]
83-
command=caddy run --config /etc/caddy/Caddyfile
83+
environment=SVC="peekaping"
84+
command=/bin/sh -c 'caddy run --config /etc/caddy/Caddyfile | jq --arg svc "$SVC" ". + {svc: \$svc}"'
8485
autostart=true
8586
autorestart=true
8687
user=root

0 commit comments

Comments
 (0)