Is there a way to format the timestamp from uwsgi

Solution 1:

Reading thru the code on github I found an issue that hinted at the solution.

Here is the command line I ended up using

uwsgi --log-date="%Y:%m:%d %H:%M:%S" --logformat-strftime --logformat="%(ftime) %(addr) (%(proto) %(status)) %(method) %(uri) : Retned %(size) bytes in %(msecs) msecs to %(uagent)" --http :9090 --wsgi-file foo.py 

There is virtually no way I could have come up with that by reading the docs. It does require all 3 options (not sure if the order matters) and the use of (%ftime) which is NOT mentioned on the logformat documentation page at all, only in the change log for one of the releases.

It does not appear possible to get the milliseconds in the log line