diff options
author | Omar Polo <op@omarpolo.com> | 2023-07-25 20:07:26 +0000 |
---|---|---|
committer | Omar Polo <op@omarpolo.com> | 2023-07-25 20:07:26 +0000 |
commit | abd261d25bdfa01c44d07a9803db669bc62ddf76 (patch) | |
tree | b7138101f8d0cb2b2fe64eea13c35f3b1a0a3a1b /parse.y | |
parent | 2a28b0442431d06f1989c9c4861c442bca5c7dcf (diff) |
allow to change the logging style; introduce some new ones
add `log style <style>'; The old default is called `legacy' now, a
new default format is added called `condensed', and `common' and
`combined' to mimick Apache httpd and nginx (respectively) are also
added.
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 23 |
1 files changed, 20 insertions, 3 deletions
@@ -124,16 +124,16 @@ typedef struct { %token ACCESS ALIAS AUTO %token BLOCK -%token CA CERT CHROOT CLIENT +%token CA CERT CHROOT CLIENT COMBINED COMMON CONDENSED %token DEFAULT %token FASTCGI FOR_HOST %token INCLUDE INDEX IPV6 %token KEY -%token LANG LISTEN LOCATION LOG +%token LANG LEGACY LISTEN LOCATION LOG %token OCSP OFF ON %token PARAM PORT PREFORK PROTO PROTOCOLS PROXY %token RELAY_TO REQUIRE RETURN ROOT -%token SERVER SNI SOCKET STRIP SYSLOG +%token SERVER SNI SOCKET STRIP STYLE SYSLOG %token TCP TOEXT TYPE TYPES %token USE_TLS USER %token VERIFYNAME @@ -268,6 +268,18 @@ logopt : SYSLOG { free(conf->log_access); conf->log_access = $2; } + | STYLE COMMON { + conf->log_format = LOG_FORMAT_COMMON; + } + | STYLE COMBINED { + conf->log_format = LOG_FORMAT_COMBINED; + } + | STYLE CONDENSED { + conf->log_format = LOG_FORMAT_CONDENSED; + } + | STILE LEGACY { + conf->log_format = LOG_FORMAT_LEGACY; + } ; vhost : SERVER string { @@ -603,6 +615,9 @@ static const struct keyword { {"cert", CERT}, {"chroot", CHROOT}, {"client", CLIENT}, + {"combined", COMBINED}, + {"common", COMMON}, + {"condensed", CONDENSED}, {"default", DEFAULT}, {"fastcgi", FASTCGI}, {"for-host", FOR_HOST}, @@ -611,6 +626,7 @@ static const struct keyword { {"ipv6", IPV6}, {"key", KEY}, {"lang", LANG}, + {"legacy", LEGACY}, {"listen", LISTEN}, {"location", LOCATION}, {"log", LOG}, @@ -631,6 +647,7 @@ static const struct keyword { {"sni", SNI}, {"socket", SOCKET}, {"strip", STRIP}, + {"style", STYLE}, {"syslog", SYSLOG}, {"tcp", TCP}, {"to-ext", TOEXT}, |