Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set Winston date format string to get microseconds resolution?

I have the following Winston logger format:

simple(),
colorize(),
timestamp({ format: 'YYYY-MM-DD HH:mm:ss.SSS' })

Which gives me timestamps in milliseconds resolution. What should I change in the format string to get the timestamp in microseconds?

like image 511
omer Avatar asked Jan 21 '26 02:01

omer


1 Answers

So it turns out microseconds resolution is not supported in Winston. Winston is using fecha under the hood for timestamp formatting, and fecha does not support microseconds resolution at the moment. I opened the following github issue requesting fecha to add this feature.

like image 69
omer Avatar answered Jan 22 '26 15:01

omer