Welcome! Log In Create A New Profile

Advanced

A print command for writing to a log

Posted by jared 
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.
A print command for writing to a log
July 22, 2009 07:59PM
It would be great if there were a directive for writing a string of my choice to a log file, such as:

[code]
location ~ /some/path/.*/foo {
print_to_log "In new rule I'm working on"
if ($something ~ ^reg(.*)exp$) {
print_to_log "$something matched; captured $1"
}
...
}
[/code]

I've read that nginx can be compiled in debug mode, but that's a really heavy solution. I generally want to write rules and iterate on them quickly.

Igor, thanks for all your excellent work on nginx!

Jared

Online Users

Guests: 82
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready