'uWSGI log format to capture request number and count

The default log format includes the request number and number of requests. However I don't see a way to reference those variables in a custom log format.

Any idea how I can sprinkle them in?

(see the ??? here)

log-format = [pid: %(pid)|app: ???|req: ???/???] %(addr) (%(user)) {%(vars) vars in %(pktsize) bytes} [%(ctime)] %(method) %(uri) => generated %(rsize) bytes in %(msecs) msecs (%(proto) %(status)) %(headers) headers in %(hsize) bytes (%(switches) switches on core %(core)) %(var.HTTP_STARTTIMESTAMP) %(var.HTTP_REFERER)


Solution 1:[1]

The default log format for uWSGI is as follows:

log-format = [pid: %(pid)|app: -|req: -/-] %(addr) (%(user)) {%(vars) vars in %(pktsize) bytes} [%(ctime)] %(method) %(uri) => generated %(rsize) bytes in %(msecs) msecs (%(proto) %(status)) %(headers) headers in %(hsize) bytes (%(switches) switches on core %(core))

app: -|req: -/- appear to be what you're looking for.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 sytech