From 21ec4808ece550f8abd9ed8551d4dfe5fa58ae30 Mon Sep 17 00:00:00 2001 From: Tan Jiang Date: Mon, 30 Apr 2018 18:16:11 +0800 Subject: [PATCH] Collect log of redis Previously the log file was set to a hard coded file, but given this redis should run in container, the update is made to have the process output log messages to standard output, and redirect it to syslog in docker-compose template. --- make/docker-compose.tpl | 7 +++++++ make/photon/redis/redis.conf | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/make/docker-compose.tpl b/make/docker-compose.tpl index 45bf78ce8..5556b393f 100644 --- a/make/docker-compose.tpl +++ b/make/docker-compose.tpl @@ -119,6 +119,13 @@ services: - /data/redis:/data networks: - harbor + depends_on: + - log + logging: + driver: "syslog" + options: + syslog-address: "tcp://127.0.0.1:1514" + tag: "redis" proxy: image: vmware/nginx-photon:__nginx_version__ container_name: nginx diff --git a/make/photon/redis/redis.conf b/make/photon/redis/redis.conf index 71e66d265..9b56e6573 100644 --- a/make/photon/redis/redis.conf +++ b/make/photon/redis/redis.conf @@ -168,7 +168,7 @@ loglevel notice # Specify the log file name. Also the empty string can be used to force # Redis to log on the standard output. Note that if you use standard # output for logging but daemonize, logs will be sent to /dev/null -logfile "/var/log/redis/redis.log" +logfile "" # To enable logging to the system logger, just set 'syslog-enabled' to yes, # and optionally update the other syslog parameters to suit your needs.