Added access log to server and modified mock-fts to use it

This commit is contained in:
bwilliams committed 2026-10-16 08:38:41 +01:00
1 parent 2490519c2b
commit 02e3d910a2
10 files changed
+389 -29

No files matched your search

+1
View File
@@ -101,6 +101,7 @@ The `server` section is split into a number of sub-sections:
| `server.port` | int | `9393` | Port to listen on; `0`: any free port |
| `server.max_header_bytes` | byte size | `8KB` | Largest request header block; `0B` for 8KB. `-1` (no limit) is rejected, as the HTTP server always has one |
| `server.max_body_bytes` | byte size | `1MB` | Largest request body; `0B` for 1MB, `-1` for no limit |
| `server.access_log` | string | | File the access log is appended to, one line per request in the Combined Log Format; `-`: stdout; empty: no access log. `serve --access-log` overrides it |
#### Timeouts
+4
View File
@@ -15,11 +15,15 @@ const JSCKServer string = "server"
// port). MaxHeaderBytes is the largest request header block; 0 means the
// default (8KB), and -1 (no limit) is rejected (see validate). MaxBodyBytes is
// the largest request body; 0 means the default (1MB) and -1 no limit.
// AccessLog is the file the access log is appended to, one line per request
// in the Combined Log Format; "-" means stdout, and empty means no access
// log.
type JSCServer struct {
Host string `cfg:"host" default:"127.0.0.1"`
Port int `cfg:"port" default:"9393"`
MaxHeaderBytes util.ByteSize `cfg:"max_header_bytes" default:"8KB"`
MaxBodyBytes util.ByteSize `cfg:"max_body_bytes" default:"1MB"`
AccessLog string `cfg:"access_log"`
Timeouts JSCServerTimeouts `cfg:"timeouts"`
RateLimits JSCServerRateLimits `cfg:"rate_limits"`
Proxy JSCServerProxy `cfg:"proxy"`