Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

102
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!