ユーザ用ツール

サイト用ツール


サイドバー



最近の更新



Tag Cloud

タグ数量
9
10
1
3
1
2
17
7
1
1
4
13
4
1
2
325
1
9
2
7
21
5
1
31
3
3
1
6
1
1
46
1
3
3
1
1
1
1
1
1
35
46
7
9
10
8
10
3
22
2
9
2
2
6
9
1
1
6
12
4
3
3
2
1
8
2
4
1
6
30
2
12
5
3
1
1
2
3
2
1
3
4
3
3
4
2
2
1
1
2
1
2
1
2
1
27
2
1
3
2
2
1
1
2
3
17
5
9
1
1
2
18
2
6
1
2
12
1
3
1
1
4
12
1
6
4
2
7
1
3
2
13
1
4
1
1
11
3
1
18
3
1
5
1
2
1
1
2
10
2
2
3
2
1
3
1
3
1
2
2
2
1
2
6
1
4
3
5
1
3
1
3
3
2
1
1
30
1
3
3
1
1
1
5
5
1
36
2
4
2
1
2
2
3
1
1
1
4
1
2
1
3
1
1
1
2
5
2
5
2
1
1
1
5
3
2
4
7
1
2
2
27
1
1
3
5
1
1
2
1
1
2
1
1
1
1
2
1
1
1
1
2
20
8
1
7
1
1
3
1
2
2
1
2
1
1
1
1
1
1
2
1
1
2
1
1
1
1
1
1
1
5
2
1
1
2
2
2
1
1
2
1
1
1
12
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
2
2
06_virtualization:05_container:23_docker_logs

23 Docker log設定

ログの場所

# ls -alh /var/lib/docker/containers/*/*-json.log
# docker inspect app-proxy-1 | grep -i log
        "LogPath": "/var/lib/docker/containers/415a09895929c250e05f2ec463c2affc144166884a93b1591e8cd2a884b86a7a/415a09895929c250e05f2ec463c2affc144166884a93b1591e8cd2a884b86a7a-json.log",
            "LogConfig": {

1.ログを消す

# truncate -s 0 /var/lib/docker/containers/415a09895929c250e05f2ec463c2affc144166884a93b1591e8cd2a884b86a7a/415a09895929c250e05f2ec463c2affc144166884a93b1591e8cd2a884b86a7a-json.log

2. docker-compose.ymlで設定

docker-compose.yml

services:
  app:
    logging:
      driver: "json-file"
      options:
        max-size: "10m"
        max-file: "3"

3. Dockerの設定ファイル

/etc/docker/daemon.json

{
   "log-driver": "json-file",
   "log-opts": {"max-size": "10m", "max-file": "3"}
}
06_virtualization/05_container/23_docker_logs.txt · 最終更新: 2022/10/03 22:52 by matsui

Yesterday:380 Today:552 Total:108996