카타코더 Docker - Manage Container Log Files

1 개요[ | ]

카타코더 Docker - Manage Container Log Files
카타코더 Docker - Managing Log Files
카타코더 Docker
# 🔗 제목
카타코더 Docker/2 e
🡵 카타코더 Docker - Manage Container Log Files
🡵 카타코더 Docker - Ensuring Container Uptime With Restart Policies
🡵 카타코더 Docker - Adding Docker Metadata & Labels
🡵 카타코더 Docker - Load Balancing Containers
🡵 카타코더 Docker - Orchestration using Docker Compose
🡵 카타코더 Docker - See Container Metrics With Docker Stats
🡵 카타코더 Docker - Creating Optimised Docker Images using Multi-Stage Builds
🡵 카타코더 Docker - Formatting PS Output
🡵 카타코더 Docker - Run Docker From Rootless Users
🡵 카타코더 Docker - Learn Docker Swarm 101
🡵 카타코더 Docker - Docker Swarm Mode Playground

2 Docker Logs[ | ]

Console
Copy
$ docker run -d --name redis-server redis
784c2bc73d133ce7eb7140b9f8057664dfce1081624e0fda97d1b5d7baf2dc4e
Console
Copy
$ docker logs redis-server
1:C 23 Mar 2019 10:57:26.326 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 23 Mar 2019 10:57:26.326 # Redis version=5.0.4, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 23 Mar 2019 10:57:26.326 # Warning: no config file specified, usingthe default config. In order to specify a config file use redis-server /path/to/redis.conf
1:M 23 Mar 2019 10:57:26.327 * Running mode=standalone, port=6379.
1:M 23 Mar 2019 10:57:26.327 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
1:M 23 Mar 2019 10:57:26.327 # Server initialized
1:M 23 Mar 2019 10:57:26.327 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
1:M 23 Mar 2019 10:57:26.327 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never> /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
1:M 23 Mar 2019 10:57:26.327 * Ready to accept connections

3 SysLog[ | ]

Console
Copy
$ docker run -d --name redis-syslog --log-driver=syslog redis
2d44e148bf4267c16a88fbd714b483ab4290b53aad5535d9b590aedfb3a1d133

4 Disable Logging[ | ]

Console
Copy
$ docker run -d --name redis-none --log-driver=none redis
b047218eb5547a80ed5cfd8012fc9a399a290f702775cc2c18a5fc9d59d640bb
Console
Copy
$ docker inspect --format '{{ .HostConfig.LogConfig }}' redis-server
{json-file map[]}
Console
Copy
$ docker inspect --format '{{ .HostConfig.LogConfig }}' redis-syslog
{syslog map[]}
Console
Copy
$ docker inspect --format '{{ .HostConfig.LogConfig }}' redis-none
{none map[]}

5 같이 보기[ | ]