Skip to content

End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

Logger#datetime_format=

datetime_format=(datetime_format)

Sets the date-time format.

Argument datetime_format should be either of these:

  • A string suitable for use as a format for method Time#strftime.

  • nil: the logger uses '%Y-%m-%dT%H:%M:%S.%6N'.

See also #datetime_format #debug #close #debug! also in 3.4 · 3.3 · 3.1 · 3.0