Answer the question
In order to leave comments, you need to log in
How to make nginx custom log format in docker-compose?
like this log_format customLogFormat '$remote_addr - $remote_user [$time_local] "$request" '
'$status "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
put here in docker-compose.yml
nginx-service:
image: nginx
container_name: nginx-service
ports:
- 8000:80
environment:
- FOO=bar
logging:
driver: loki
options:
loki-url: localhost:3100/loki/api /v1/push
loki-external-labels: job=dockerlogs,owner=ruan,environment=development
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question