Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add a timestamp to my Python app uwsgi log?

Tags:

logging

uwsgi

My Python application sends logs to stderr, UWSGI redirects it into /var/log/uwsgi/app/myapplication.log. What is the simplest way to prefix my app log output with a timestamp? I prefer to do this with uwsgi.ini config, w/o change application code.

TIA, Vitaly

like image 644
Vitaly Karasik - Freelancer Avatar asked Jun 05 '14 15:06

Vitaly Karasik - Freelancer


1 Answers

--logdate will do the trick.

eventually it takes an optional strftime-like string:

--logdate="%s"

will add the unix time as well as

--logdate="%d/%m/%Y"

will add the day/month/year prefix

like image 108
roberto Avatar answered Sep 24 '22 17:09

roberto