diff mbox series

[meta-webserver,2/3] nginx: log error_log at notice level by default

Message ID 20260502205501.185550-2-tim.orling@konsulko.com
State New
Headers show
Series [meta-webserver,1/3] nginx: upgrade stable 1.28.3 -> 1.30.0 | expand

Commit Message

Tim Orling May 2, 2026, 8:55 p.m. UTC
From: Tim Orling <tim.orling@konsulko.com>

When the error_log directive omits a severity (as in our shipped
nginx.conf), nginx defaults to 'error' level, which filters out the
entire notice-level startup banner: 'using the "epoll" event method',
the version line, 'start worker process N', and the corresponding
exit/reload events. The result is an nginx that appears completely
silent on stdout/stderr in foreground or container deployments — a
common confusion for anyone running 'nginx -g "daemon off;"' as a
container entrypoint and wondering why no logs appear.

Set the level to 'notice' in the default nginx.conf to surface those
events. This matches what upstream Debian and the official nginx
Docker image ship for the same reason. The change is essentially
free for traditional service deployments: notice-level events are
infrequent (master start/stop, config reload, worker recycling) and
remain useful diagnostic output rather than noise.

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
---
 meta-webserver/recipes-httpd/nginx/files/nginx.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tim Orling May 3, 2026, 5:49 p.m. UTC | #1
Please hold off on this. It did not clearly fix the container use case and
might otherwise be undesired expansion of resource use in embedded targets.

On Sat, May 2, 2026 at 1:55 PM <tim.orling@konsulko.com> wrote:

> From: Tim Orling <tim.orling@konsulko.com>
>
> When the error_log directive omits a severity (as in our shipped
> nginx.conf), nginx defaults to 'error' level, which filters out the
> entire notice-level startup banner: 'using the "epoll" event method',
> the version line, 'start worker process N', and the corresponding
> exit/reload events. The result is an nginx that appears completely
> silent on stdout/stderr in foreground or container deployments — a
> common confusion for anyone running 'nginx -g "daemon off;"' as a
> container entrypoint and wondering why no logs appear.
>
> Set the level to 'notice' in the default nginx.conf to surface those
> events. This matches what upstream Debian and the official nginx
> Docker image ship for the same reason. The change is essentially
> free for traditional service deployments: notice-level events are
> infrequent (master start/stop, config reload, worker recycling) and
> remain useful diagnostic output rather than noise.
>
> Signed-off-by: Tim Orling <tim.orling@konsulko.com>
> ---
>  meta-webserver/recipes-httpd/nginx/files/nginx.conf | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta-webserver/recipes-httpd/nginx/files/nginx.conf
> b/meta-webserver/recipes-httpd/nginx/files/nginx.conf
> index 6d219422b3..afbd79f9ac 100644
> --- a/meta-webserver/recipes-httpd/nginx/files/nginx.conf
> +++ b/meta-webserver/recipes-httpd/nginx/files/nginx.conf
> @@ -29,7 +29,7 @@ http {
>
>      ## Logging
>      access_log /var/log/nginx/access.log;
> -    error_log /var/log/nginx/error.log;
> +    error_log /var/log/nginx/error.log notice;
>
>      ## Gzip settings
>      gzip  on;
> --
> 2.47.3
>
>
diff mbox series

Patch

diff --git a/meta-webserver/recipes-httpd/nginx/files/nginx.conf b/meta-webserver/recipes-httpd/nginx/files/nginx.conf
index 6d219422b3..afbd79f9ac 100644
--- a/meta-webserver/recipes-httpd/nginx/files/nginx.conf
+++ b/meta-webserver/recipes-httpd/nginx/files/nginx.conf
@@ -29,7 +29,7 @@  http {
 
     ## Logging
     access_log /var/log/nginx/access.log;
-    error_log /var/log/nginx/error.log;
+    error_log /var/log/nginx/error.log notice;
 
     ## Gzip settings
     gzip  on;