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

214
Views
Save log from chrom console by JavaScript

I am writing a monitoring addon for the website.

Is it possible to get logs and errors from the chrome console by JavaScript?

I tried to override the console log and other functions but it only recorded logs generated by my own code.

I would like to catch logs and errors output by 3rd party lib as well. for example, if I am writing a website using jQuery I would like to collect all logs and errors output by jquery as well.

thanks

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

How about trying this? You can modify the global console.log

const overridedConsole = (function(originConsole){
    return {
        log: function(text){
            originConsole.log(text);
            // maybe save?
        },
        info: function (text) {
            originConsole.info(text);
            // maybe save?
        },
        warn: function (text) {
            originConsole.warn(text);
            // maybe save?
        },
        error: function (text) {
            originConsole.error(text);
            // maybe save?
        }
    };
}(window.console));

//Then redefine the old console
window.console = overridedConsole;
about 4 years ago · Juan Pablo Isaza Report
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!