On 27 March 2015 at 05:10, Roberto De Ioris <[email protected]> wrote:
> > could somebody tell me whether the default log format is explained
> > somewhere? I.e. the exact meanings of the numbers and other data in
> > lines such as:
> >
> > [pid: 596|app: 0|req: 24/72] 222.127.73.32 () {50 vars in 1043
> > bytes} [Wed Jan 14 11:44:29 2015] POST /countries/ => generated 2 bytes
> > in 149 msecs (HTTP/1.1 200) 3 headers in 112 bytes (1 switches on core 0)
>
> Every kind of doc improvements is wellcomed (no-one want to write docs,
> and everyone always rant about docs, so it is a catch 22 world ;)
>
> Btw:
>
> pid -> the pid of the worker managing the request
> app -> the id (it is a integer, starting from 0) of the app, it makes
> sense when multiple apps are hosted in the same instance. It is -1 when no
> app managed the request (like when serving static files) or when the 'app'
> concept does not apply (like with php or cgi's)
> req: N/M -> N is the number of managed requests by the current worker for
> the specific app, M is the grand total (sum of all requests of all
> workers)
I'm trying to simply add a single variable to my existing log.
Unfortunately, to do that, I need to recreate the existing log format
and then make my changes. I've been able to figure out everything
except for the 'app' and 'req N/M' described above. There doesn't
appear to be any existing `logformat` variable to describe those
things.
To improve the `logformat` documentation I suggest listing the
formatting used to render the default logging (if that's possible). I
have come up with the following so far:
logformat = [pid: %(pid)|app: ??|req: ??/??] %(addr) () {%(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))
I was wondering if perhaps 'app' and 'req' is available somehow in the
%(metric.XXX) tags, but those only seem to work if you include
--enable-metrics .
Also, from the description given above, I'm not even sure if the
default logging is working properly... My logs are always of the
format "req: N/M" where N > M. If M is the total, shouldn't N <=M? I
have log entries that are M+1/M and M+2/M. I'm using a single process
with multiple async cores (if I use 2 processes, this seems to
change).
To me, it seems like a minimal requirement of the `logformat` is that
it can replicate the default log format so it's possible to modify the
default when slight changes are needed. It seems like it's nearly
there, though.
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi