microsoft / applicationinsights-angularplugin-js

MIT License
31 stars 17 forks source link

Disable logging in local environment #118

Closed szilardd closed 1 year ago

szilardd commented 1 year ago

Is there a way to disable logging? I still want to initialize the logging but in my local environment but I don't want it to trigger sending to App Insights.

I tried with:

I know that it is possible to set a custom endpointUrl as described here but if I set a dummy URL it still tries to send the logs there and I get an error in the browser console.

Thanks

MSNev commented 1 year ago

Yes, there is a disableTelemetry configuration that when set to true will process the entire pipeline, but when it is attempted to be "batched" for sending every event is dropped.

I assume you are looking to do this for local / ci testing?

szilardd commented 1 year ago

Thanks, it works! Yes, I want to disable logging in my local environment.

github-actions[bot] commented 2 months ago

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.