How to prevent sending logs from local environment? #4861
-
Hi, |
Beta Was this translation helpful? Give feedback.
Answered by
vladanpaunovic
Apr 28, 2022
Replies: 1 comment
-
A better way to go about this is to still send it, yet separate the environment. In Sentry.io you will be able to see only You can do this by providing the ExampleSentry.init({
dsn: "YOUR_PROJECT_DSN",
sampleRate: 1,
environment: provess.env.NODE_ENV
}); Another way to do it (not recommended) is to conditionally load Sentry. if (process.env.NODE_ENV === "production") {
Sentry.init({
dsn: "YOUR_PROJECT_DSN",
sampleRate: 1,
environment: "production"
});
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
vladanpaunovic
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A better way to go about this is to still send it, yet separate the environment. In Sentry.io you will be able to see only
development
orproduction
logs.You can do this by providing the
environment
option toSentry.init();
. You can find the docs on it here.Example
Another way to do it (not recommended) is to conditionally load Sentry.