Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

diag/setLogger has confusing warning which seems like an Error when logger gets overwritten #3648

Closed
altinokdarici opened this issue Mar 1, 2023 · 3 comments
Labels

Comments

@altinokdarici
Copy link
Contributor

diag/setLogger has confusing warning which seems like an Error when logger gets overwritten.

Log sample:
Screenshot 2023-02-28 at 6 16 35 PM
As you can see in the above log, the first line ends with 'Error' keyword.

I think the below code cause this issue. Stack variable seems to start with Error

        const stack = new Error().stack ?? '<failed to generate stacktrace>';
        oldLogger.warn(`Current logger will be overwritten from ${stack}`);
        newLogger.warn(
          `Current logger will overwrite one already registered from ${stack}`
        );

https://github.com/open-telemetry/opentelemetry-js/blob/main/api/src/api/diag.ts#L97-L101

@naseemkullah
Copy link
Member

Hi @altinokdarici - there was an option added a little while ago via #3366 called suppressOverrideMessage to silence this log. Does that work for you?

@github-actions
Copy link

github-actions bot commented May 8, 2023

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.

@github-actions github-actions bot added the stale label May 8, 2023
@github-actions
Copy link

This issue was closed because it has been stale for 14 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants