File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -241,3 +241,45 @@ routes{
241
241
},
242
242
}
243
243
```
244
+
245
+ ## Request logging
246
+
247
+ Results of requests to backend pools can be selectively enabled in the
248
+ configuration. Logs can then be viewed by connecting and running `watch
249
+ proxyreqs` - Log lines are not generated internally a connection is reading
250
+ them, but it is still recommended to configure the ` rate ` option or other
251
+ constraints.
252
+
253
+ Logs look like: `ts=time gid=num type=proxy_req elapsed=us type=num
254
+ code=num status=num res=num cfd=fdnum be=host: port detail=tag req=get key\n`
255
+
256
+ ``` lua
257
+ settings {
258
+ backend_options = {
259
+ log = {
260
+ rate = 5 , -- log one out of every 5 by random chance
261
+ errors = true , -- log all errors
262
+ deadline = 250 , -- log all results slower than 250ms
263
+ tag = " all" -- informational tag for log
264
+ }
265
+ }
266
+ }
267
+
268
+ pools {
269
+ main = {
270
+ -- per-pool logging options.
271
+ --[[ backend_options = {
272
+ -- if no constraints given, log everything (SLOW!)
273
+ log = { tag = "mainpool" }
274
+ },--]]
275
+ backends = {
276
+ " 127.0.0.1:11214" ,
277
+ " 127.0.0.1:11215" ,
278
+ }
279
+ }
280
+ }
281
+
282
+ routes {
283
+ default = route_direct { child = " main" }
284
+ }
285
+ ```
You can’t perform that action at this time.
0 commit comments