nginx / nginx/docker-nginx

Don't redirect error_log to stderr

Open
#940 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Shell
Stars
3.5k
Forks
1.8k
Avg merge
42m
Merged PRs (30d)
2

Description

Describe the bug

According to https://nginx.org/en/docs/ngx_core_module.html#error_log default error_log level for Nginx should be error, but official docker image is built with level notice. This produces all sorts of issues in logging/monitoring systems. Most often, just graceful ordinary restart produces errors in logs (and then alerts).

Image

To reproduce

Steps to reproduce the behavior:

  1. Run the NGINX Docker image.
  2. Check /var/log/nginx/error.log for startup notices (which are not actually errors).
Expected behavior

error_log should be set to error or maybe warn level, definitely not notice.

Your environment
  • nginx:1.25.1-alpine-slim
  • Kubernetes / Docker Desktop

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the behavior with the nginx:1.25.1-alpine-slim Docker image and inspect the configuration responsible for /var/log/nginx/error.log. Confirm that startup notices appear after a graceful restart, then verify that the configured error_log level prevents those notices from being emitted as errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, nginx
Domain
devops, infrastructure
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.