docker logs -t
needs to strip carriage return character to show timestamp
#49076
Labels
kind/bug
Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed.
status/0-triage
Description
docker logs -t
should prefix every log line with a timestamp like2024-12-12T10:47:47.310209758Z
.When the container is using
\n\r
at the end of a log line (or\r
at beginning), then the timestamp is overwritten and not shown.docker logs
should probably strip the/r
, at least when used with-t
option, maybe just on Linux.The issue happens for example with containers based on
mcr.microsoft.com/mssql/server:2022-latest
image on Linux.See discussion on Docker Community Forum.
Reproduce
outputs
The last example has an overwritten timestamp
Expected behavior
The timestamp should always be shown, irrespectively of the log line content.
docker version
docker info
Additional Info
No response
The text was updated successfully, but these errors were encountered: