How to log in nginx module request handler?
Kindly point to the docs if its already presented elsewhere.
For now:
static ngx_int_t ngx_http_printer_hander(ngx_http_request_t* r) {
// ...
ngx_log_error(NGX_LOG_INFO, r->connection->log, 0, "Hello LOG!");
// ...
I picked this up from the source code. And this works. But this always logs to error.log.
- I'm looking for ways to log to specific log file.
- Some information about creating a custom log object is appreciated.
Thanks,