oriolrius.cat

Des del 2000 compartiendo sobre…

Truncate docker logs

Reading time: 2 – 4 minutes

Sometimes when a container is running for a long time especially when docker logs command is called the logs dump is extra long and then a recurrent search on google for reminding how to truncate a file is mandatory for avoiding this repeating task this is the trick that it saves me from that uncomfortable long log dump.

truncate -s 0 $(docker inspect --format='{{.LogPath}}' CONTAINER_ID)

Últimas entradas

Resumen 2023

Reading time: 14 – 22 minutes El 2023 comenzó con una sensación de renovación y optimismo. Tras un período marcado

Leer más »
Archivo
Scroll to Top