summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_router_access_log.c (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2024-01-29HTTP: enhanced access log with conditional filtering.Zhidao HONG1-0/+25
This feature allows users to specify conditions to control if access log should be recorded. The "if" option supports a string and JavaScript code. If its value is empty, 0, false, null, or undefined, the logs will not be recorded. And the '!' as a prefix inverses the condition. Example 1: Only log requests that sent a session cookie. { "access_log": { "if": "$cookie_session", "path": "..." } } Example 2: Do not log health check requests. { "access_log": { "if": "`${uri == '/health' ? false : true}`", "path": "..." } } Example 3: Only log requests when the time is before 22:00. { "access_log": { "if": "`${new Date().getHours() < 22}`", "path": "..." } } or { "access_log": { "if": "!`${new Date().getHours() >= 22}`", "path": "..." } } Closes: https://github.com/nginx/unit/issues/594
2022-11-20Basic njs support.Zhidao HONG1-1/+1
2022-11-20Var: separating nxt_tstr_t from nxt_var_t.Zhidao HONG1-12/+15
It's for the introduction of njs support. For each option that supports native variable and JS template literals introduced next, it's unified as template string. No functional changes.
2022-07-28Log: customizable access log format.Zhidao HONG1-117/+113
2022-07-14Log: split access log from nxt_router.c.Zhidao HONG1-0/+446
No functional changes.