tags:

views:

38

answers:

1

Hi all!

Maybe my question is obvious, but I can't find answer in NLog documentation. How to write a layout for NLog that outputs time with milliseconds like this 11:32:08:1234? Now I use ${date:format=yyyy-MM-dd HH\:mm\:ss} but I need more time precision in my logs.

Thanks!

+2  A: 

${date:format=yyyy-MM-dd HH\:mm\:ss.fff}

According to the NLog documentation, you can use C# DateTime format string.

This is a pretty good reference for DateTime format strings: http://www.geekzilla.co.uk/View00FF7904-B510-468C-A2C8-F859AA20581F.htm

mhughes
Thank you! Exactly what I needed!
levanovd