|
| 1 | +## Redirecting syslog to /dev/stdout |
| 2 | + |
| 3 | +By default, Quay Enterprise logs most relevant for debugging to `/var/log/syslog` within the container. [syslog-ng](https://en.wikipedia.org/wiki/Syslog-ng) can be configured to redirect these logs to `/dev/stdout` which will allow for collection by most logging solutions: |
| 4 | + |
| 5 | +Create `syslog-ng-extra.conf` with the following content: |
| 6 | + |
| 7 | +``` |
| 8 | +source s_docker_syslog { file("/var/log/syslog"); }; |
| 9 | +destination d_docker_syslog { file("/dev/stdout"); }; |
| 10 | +log { |
| 11 | + source(s_docker_syslog); |
| 12 | + destination(d_docker_syslog); |
| 13 | +
|
| 14 | +}; |
| 15 | +``` |
| 16 | +### Single Container |
| 17 | + |
| 18 | +Place the `syslog-ng-extra.conf` file into the configuration directory: |
| 19 | + |
| 20 | +``` |
| 21 | +$ ls quay/config/ |
| 22 | +config.yaml license ssl.cert ssl.key syslog-ng-extra.conf |
| 23 | +``` |
| 24 | + |
| 25 | +Restart the Quay Enterprise container: |
| 26 | + |
| 27 | +``` |
| 28 | +$ docker ps |
| 29 | +0f6c27088c32 quay.io/coreos/quay:v2.4.0 "/sbin/my_init" 27 hours ago Up 3 hours 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp, 8443/tcp epic_banach |
| 30 | +
|
| 31 | +docker restart 0f6c27088c32 |
| 32 | +``` |
| 33 | + |
| 34 | +### Kubernetes |
| 35 | + |
| 36 | +base64 encode the `syslog-ng-extra.conf` file: |
| 37 | + |
| 38 | +``` |
| 39 | +$ cat /config/syslog-ng-extra.conf | base64 -w 0 |
| 40 | +
|
| 41 | +c291cmNlIHNfZG9ja2VyX3N5c2xvZyB7IGZpbGUoIi92YXIvbG9nL3N5c2xvZyIpOyB9Owpk |
| 42 | +ZXN0aW5hdGlvbiBkX2RvY2tlcl9zeXNsb2cgeyBmaWxlKCIvZGV2L3N0ZG91dCIpOyB9Owpsb |
| 43 | +2cgeyAKCXNvdXJjZShzX2RvY2tlcl9zeXNsb2cpOyAKCWRlc3RpbmF0aW9uKGRfZG9ja2VyX |
| 44 | +3N5c2xvZyk7IAoKfTsK |
| 45 | +``` |
| 46 | + |
| 47 | +Edit the Quay Enterprise config secret file: |
| 48 | + |
| 49 | +``` |
| 50 | +$ kubectl --namespace quay-enterprise edit secret/quay-enterprise-config-secret |
| 51 | +``` |
| 52 | + |
| 53 | +Add an entry for the `syslog-ng-extra.conf` file: |
| 54 | + |
| 55 | +``` |
| 56 | +syslog-ng-extra.conf: |
| 57 | +<-base64 encoded syslog-ng-extra.conf-> |
| 58 | +``` |
| 59 | + |
| 60 | +Delete `quay-enterprise-app` pods to trigger the quay-enterprise deployment to schedule pods with the updated configuration: |
| 61 | + |
| 62 | +``` |
| 63 | +$ kubectl -n quay-enterprise get pods |
| 64 | +NAME READY STATUS RESTARTS AGE |
| 65 | +quay-enterprise-app-1576414776-vv4vv 1/1 Running 0 3h |
| 66 | +quay-enterprise-app-1623234786-twrc2 1/1 Running 0 3h |
| 67 | +quay-enterprise-redis-3163299701-mdw95 1/1 Running 0 3h |
| 68 | +``` |
| 69 | + |
| 70 | +``` |
| 71 | +$ kubectl -n quay-enterprise delete pod/quay-enterprise-app-1576414776-vv4vv |
| 72 | +$ kubectl -n quay-enterprise delete pod/quay-enterprise-app-1623234786-twrc2 |
| 73 | +``` |
0 commit comments