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

103
Visualizações
using ajax in flask to load live logs

I am looking for some help, regarding my web server. I have a flask web server, designed to search in log files, and it does the job, but I need something else. To access the live data, to see the logs live.

It's an internal application, so the security is not a concern. The main thing it should do, is to open a file and basically simulate a "tail" command.Read the last lines, then just append the new ones, and basically that's all. I was thinking to go with an AJAX call, but i'm not really good (at all) with JavaScript.

I was wondering about this solution :

var byteRead=0;
setInterval(function(){

   $.ajax({ 
        type: "GET", 
        url: "GenNumber.txt",
        dataType: "text", 
        success: function (data) {  
            byteRead+= data.length;
            readdata(data);
        }, 
        headers: {
            "Range" : "bytes="+byteRead+"-"
        }
    });
},1000);

But im not quiet sure about it... neither how to adapt it (js side).

Does anyone have experience with this kind of issues or ideea how to start ?

about 4 years ago · Juan Pablo Isaza
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