formatting time as milliseconds in logging module

Vinay Sajip vinay_sajip at
Wed Oct 20 11:16:13 CEST 2004

Stefan Behnel <behnel_ml at> wrote in message news:<cl2n3g$2lt$1 at>...
> Hi!
> The logging module nicely prepends each line with a formatted date.
> However, I'm not interested in the actual date but only in the number of 
> milliseconds that passed since the start of the program. What is the best 
> way of doing that?
> Thanks,
> Stefan

Use the relativeCreated attribute of the LogRecord in your message format. See


Vinay Sajip

More information about the Python-list mailing list