Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

111
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda