adubeniuk / vgs-docker

vgs trial task docker
BSD 2-Clause "Simplified" License
1 stars 0 forks source link

Define nginx container logging approach #1

Open adubeniuk opened 7 years ago

adubeniuk commented 7 years ago

There could be multiple ways to get the logs from nginx to the logging agent in the container environment.

As this is quite an important decision I would like to describe some of the available options:

First option is the easiest to implement but it could also have the worst consequences. By its design nginx will simply freeze when unable to write its logs in this case over syslog.

Second option seems rational as it will also allow us to get the logs from the Docker host itself. Also it allows us to change logging driver from syslog to any other supported logging driver including fluentd.

However none of these two options require separate logging container. Indeed we could forward the logs directly to the centralized logging server either from the nginx or the Docker host itself eliminating the need for an auxiliary logging container.

But as the separate logging agent is strictly required by the task I will proceed with the dedicated logging container option and storing nginx logs on a docker data volume.

adubeniuk commented 7 years ago

Found really good article on this https://www.loggly.com/blog/top-5-docker-logging-methods-to-fit-your-container-deployment-strategy/