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

Add a default/common config for notFoundLogLevel & redirectLogLevel #256

Open
ReDev1L opened this issue Dec 16, 2024 · 2 comments
Open

Add a default/common config for notFoundLogLevel & redirectLogLevel #256

ReDev1L opened this issue Dec 16, 2024 · 2 comments

Comments

@ReDev1L
Copy link

ReDev1L commented Dec 16, 2024

In PR #253 we've got ability to indicate log level for nextjs redirects, but currently this config is per route, would be very handy to set a default/common config in next.config.ts

@dasfmi
Copy link
Collaborator

dasfmi commented Dec 16, 2024

@ReDev1L We had the idea of Global config in mind, but I haven't tested how tow feasible it is. Tell then you can maybe create a common config and use it everywhere?

// some config file
const commonConfig = {
redirectLogLevel: 'warn'
}

and then in functions, use it or extend it:

withAxiom(..., { ...commonConfig })

@ReDev1L
Copy link
Author

ReDev1L commented Dec 17, 2024

@ReDev1L We had the idea of Global config in mind, but I haven't tested how tow feasible it is. Tell then you can maybe create a common config and use it everywhere?

// some config file
const commonConfig = {
redirectLogLevel: 'warn'
}

and then in functions, use it or extend it:

withAxiom(..., { ...commonConfig })

As workaround, i'm doing this way, but it's not human-error proof, better to have defaults set somewhere, and provide config values to functions only to override defaults in some cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants