Welcome! Log In Create A New Profile

Advanced

Using Graylog to log from Nginx in a Docker container.

Julian Brown
January 22, 2022 04:28PM
Currently I run Nginx as a reverse proxy in a Docker container.

FROM nginx

ENV DEBIAN_FRONTEND noninteractive

.... Details hidden ...

EXPOSE 80
EXPOSE 443

CMD nginx -g 'daemon off;'

We are wanting to use Graylog, and have it for our other containers. So I
want to now use it for Nginx. Graylog is like Syslog.

I went to follow this guide:

https://github.com/ronlut/graylog-content-pack-nginx-docker

It recommends we symbolically link the logs to stdout/stderr (which is
already part of the docker container) and it then uses this language (see
the bottom of the the README.md at github):

Run

Now, when your logs are collected by docker from stdout & stderr, you can
run your docker using this command:

docker run --log-driver=gelf --log-opt
gelf-address=udp://<GraylogIP>:12401 <ImageName> <Command>

for example:

docker run --log-driver=gelf --log-opt
gelf-address=udp://<GraylogIP>:12401 busybox echo Hello Graylog

<https://github.com/ronlut/graylog-content-pack-nginx-docker#screenshots>Has
anyone had any experience with this? Or understand this last set of steps?

Thank you

Julian
_______________________________________________
nginx mailing list -- nginx@nginx.org
To unsubscribe send an email to nginx-leave@nginx.org
Subject Author Posted

Using Graylog to log from Nginx in a Docker container.

Julian Brown January 22, 2022 04:28PM

Re: Using Graylog to log from Nginx in a Docker container.

Sergey A. Osokin January 23, 2022 10:52AM

Re: Using Graylog to log from Nginx in a Docker container.

Julian Brown January 23, 2022 11:04AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 284
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready