44

When you turn on the nginx rewrite log with rewrite_log on;, where does the system actually log that info? It doesn't seem to be in the documentation, and a decent search through google doesn't turn anything up.

I have also tried enabling and looking in both the access and error logs. No luck.

0

2 Answers 2

66

If rewrite_log on; is used then the rewrite information will be logged to error_log at notice level. There is no separate log file.

1
  • 6
    to log rewrites at a specific level you can specify the level by defining: error_log logs/error.log info
    – Joe B
    Commented Jun 20, 2014 at 2:20
15

by default turning "rewrite_log on;" affects only if your config file "error_log logs/error.log notice;" already marks which non-default event levels do you need to be logged.

"Setting a certain log level will cause all messages of the specified and more severe log levels to be logged."

So, first "error_log logs/error.log notice;" then "rewrite_log on;" and error.log starts receiving rewriting logging

http://nginx.org/en/docs/ngx_core_module.html#error_log http://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.