Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nginx lua log location

Tags:

nginx

lua

The Nginx lua module has a logging method:

 ngx.log(ngx.NOTICE, "hello world")

However, the docs don't indicate where this is logged to. Does it depend on the level param, ie ngx.ERROR would be in error log, while ngx.NOTICE would be in access log? Or some other file that needs to be configured?

I've added a log with ngx.INFO and not seeing anything appear in the logs folder.

like image 724
mahemoff Avatar asked Sep 14 '26 02:09

mahemoff


1 Answers

It says exactly the next line:

Log arguments concatenated to error.log with the given logging level.

You should be looking into nginx's error.log. It's configured using nginx conf:

// example
error_log  logs/error.log error;
like image 148
knh190 Avatar answered Sep 18 '26 04:09

knh190