N
N
Nikolay Baranenko2019-06-06 18:54:41
Docker
Nikolay Baranenko, 2019-06-06 18:54:41

How to configure docker to write logs to a folder named container?

Hello.
Docker logs by default

CONTAINER ID        IMAGE                     COMMAND             CREATED             STATUS              PORTS                                           NAMES
821dcb7bb9cb        prakhar1989/static-site   "./wrapper.sh"      2 days ago          Up 2 days           0.0.0.0:32773->80/tcp, 0.0.0.0:32772->443/tcp   static-site

fall into
/var/lib/docker/containers/821dcb7bb9cb7587c4806bbbeb1357052a5d9fcb05a5aa3f09821e07fa402d40/

Is it possible to configure the log upload so that its logs go to a folder called docker name in my case static-site ?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
chupasaurus, 2019-06-08
@chupasaurus

Output via syslog wherever you like, the question "why" is open.

M
metajiji, 2019-06-09
@metajiji

You rather need to learn how to read them by the name of the container, quite simply:

docker logs имя-контейнера  # просто посмотреть логи
docker logs -f имя-контейнера  # в рейлтайм режиме

You can also set up logging in applications where the flight of fancy is not limited, just do not forget about rotation, the logs can eat the entire disk.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question