Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

458
Visualizações
Tail docker logs to see recent records, not all

If you use the Coreutils tail command in Linux, you have a -f option that lets you follow a log file from the log's current position (it does not go to the very beginning of the file and display everything).

Is this functionality available in docker logs without waiting for it to traverse the whole log?

I have tried:

docker logs --since 1m somecontainer

and

docker logs -f --since 1m somecontainer

It appears that it actually traverses the entire log file (which can take a long time) and then starts echoing to the screen once it reaches the time frame you specify.

Is there a way to start tailing from the current point without waiting? Is my best option to always log out to some external file and tail that with the Coreutils tail command?

over 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

Please read docker logs --help for help. Try below, starting from the last 10 lines. More details here.

docker logs -f --tail 10 container_name
over 4 years ago · Santiago Trujillo Relatório

0

Alternatively, we can check the log by time (eg. since last 2mins) as:

docker logs --since=2m <container_id> // since last 2 minutes
docker logs --since=1h <container_id> // since last 1 hour
over 4 years ago · Santiago Trujillo Relatório

0

use the --tail switch:

>  docker logs -f <container name> --tail 10

this will show the log starting from the last 10 lines onwards

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda