Search code examples
nginxlua

Nginx lua log location


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.


Solution

  • 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;