Environment Variable for Logger Level #2623

Open
opened 2026-03-13 10:09:04 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @dagimkassagebrie on GitHub (Dec 28, 2025).

Environment Variable for Logger Level

Currently, you have to change code to set the log level. I'm wondering if we could add a BETTER_AUTH_LOG_LEVEL environment variable so developers can control logging via env vars without code changes.

I have an implementation ready that:

  • Adds BETTER_AUTH_LOG_LEVEL env var support
  • Defaults to "error" (unchanged behavior)
  • Explicit logger.level option still takes priority
  • Backward compatible with tests

Just wanted to discuss if this fits Better Auth's approach before opening a PR.

Originally created by @dagimkassagebrie on GitHub (Dec 28, 2025). ## Environment Variable for Logger Level Currently, you have to change code to set the log level. I'm wondering if we could add a `BETTER_AUTH_LOG_LEVEL` environment variable so developers can control logging via env vars without code changes. I have an implementation ready that: - Adds `BETTER_AUTH_LOG_LEVEL` env var support - Defaults to "error" (unchanged behavior) - Explicit `logger.level` option still takes priority - Backward compatible with tests Just wanted to discuss if this fits Better Auth's approach before opening a PR.
GiteaMirror added the enhancement label 2026-03-13 10:09:04 -05:00
Author
Owner

@better-auth-agent[bot] commented on GitHub (Dec 28, 2025):

It seems you have a valid proposal to add a BETTER_AUTH_LOG_LEVEL environment variable for controlling the logging level without code changes. This aligns well with the current environment variable philosophy of Better Auth, as it already supports picking configurations from environment variables like process.env.BETTER_AUTH_SECRET and process.env.BETTER_AUTH_URL [2],[3].

Your implementation that allows for a default of "error", prioritizes the explicit logger.level, and ensures backward compatibility appears to be sound. It would be beneficial to open a PR and discuss it further to see how it can fit into the current Better Auth ecosystem.

Would you like insights on any specific testing approaches for your implementation once you proceed to create the PR?

If you need more help, tag @better-auth-agent in a comment so I can respond.

DiagramDiscordGitHub

Diagram Join Star

@better-auth-agent[bot] commented on GitHub (Dec 28, 2025): It seems you have a valid proposal to add a `BETTER_AUTH_LOG_LEVEL` environment variable for controlling the logging level without code changes. This aligns well with the current environment variable philosophy of Better Auth, as it already supports picking configurations from environment variables like `process.env.BETTER_AUTH_SECRET` and `process.env.BETTER_AUTH_URL` [[2]](https://www.better-auth.com/docs/reference/options),[[3]](https://www.better-auth.com/docs/installation). Your implementation that allows for a default of "error", prioritizes the explicit `logger.level`, and ensures backward compatibility appears to be sound. It would be beneficial to open a PR and discuss it further to see how it can fit into the current Better Auth ecosystem. Would you like insights on any specific testing approaches for your implementation once you proceed to create the PR? _If you need more help, tag @better-auth-agent in a comment so I can respond._ <!-- bot:webhook reply v1 --> [Diagram](https://repodiagrams.s3.eu-north-1.amazonaws.com/skyvern_ultra_detailed_interactive.html) • [Discord](https://discord.gg/fG2XXEuQX3) • [GitHub](https://github.com/Skyvern-AI/Skyvern) [![Diagram](https://img.shields.io/badge/Diagram-2b3137?style=flat-square)](https://repodiagrams.s3.eu-north-1.amazonaws.com/skyvern_ultra_detailed_interactive.html) [![Join](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&style=flat-square)](https://discord.gg/fG2XXEuQX3) [![Star](https://img.shields.io/badge/star-181717?logo=github&logoColor=white&style=flat-square)](https://github.com/Skyvern-AI/Skyvern)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#2623