ApplicationInsights-JS icon indicating copy to clipboard operation
ApplicationInsights-JS copied to clipboard

[Question] Suppressing error messages

Open XoTENoC opened this issue 1 year ago • 1 comments

I'm working on an application where part of our code is polling a blob, and we're expecting a 404 error until the resource becomes available. While the resource doesn't exist, every time we poll, Application Insights is logging the 404 error to the console. Is there a way to suppress these error messages? Thanks.

XoTENoC avatar Aug 30 '24 11:08 XoTENoC

Application Insights is logging the 404 error to the console

I don't believe that we are the source of logging to the console?? At least by default we should not be as we avoid using the console (by default).

We have a configuration (which defaults to disabled) called loggingLevelConsole.

Which specific version are you using?

MSNev avatar Aug 30 '24 16:08 MSNev

I'm running version 2.8.8

changi-screenshot-AkPO9AMD@2x

Here is the error I'm encountering when trying to check if the object exists. The image of the error can be found directly above.

In the file util-app-insights.ts, the following code is used:

import { ApplicationInsights } from "@microsoft/applicationinsights-web";

const appInsights = new ApplicationInsights({
    config: {
        instrumentationKey: document.querySelector<HTMLElement>(".js-body-form").dataset.appInstKey,
    },
});

appInsights.loadAppInsights();
appInsights.trackPageView();

Apologies if I should have provided this information earlier.

XoTENoC avatar Aug 31 '24 08:08 XoTENoC

That doesn't look like one of our error messages from the SDK, doing a quick search online this error message might be associated with the page not being able to "fetch" (something) from an azure blob store...

Can you check the F12 network tab to see if it can identify the resource (and request) that is returning the 404?

If this was a later version then I might suspect that access to our global cfg sync json file is being highlighted, but that wasn't added until v3.x

MSNev avatar Sep 03 '24 15:09 MSNev

@MSNev Cheers for your help I appreciate your time.

XoTENoC avatar Sep 04 '24 04:09 XoTENoC

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Sep 05 '25 00:09 github-actions[bot]