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

An option to treat writes to stderr as INFO-level logs #565

Closed
agurtovoy opened this Issue Jan 31, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@agurtovoy
Copy link

agurtovoy commented Jan 31, 2018

"Currently writes to stderr are considered ERROR-level logs" doesn't play nice with debug's default logging to stderr.

A specific use case where this causes issues is enabling DEBUG logging in production using up env to troubleshoot something. It works awesomely (after a re-deploy), except that up logs get filled with "error" rather than "info" entries.

It'd be nice to have an option in up config to treat all plain text writes as "info" entries regardless of whether they are written to stderr or stdout.

A workaround on the user side is to wrap debug to override the default output (and replace all the imports).

@tj tj added the Feature Accepted label Jan 31, 2018

@tj

This comment has been minimized.

Copy link
Member

tj commented Jan 31, 2018

Any ideas for config option names? I can't think of anything great, but we have "logs": { "disable": true } already so we can shove it in there, something like

{
  "name": "app",
  "environment": {
    "DEBUG": "myapp"
  },
  "logs": {
    "stderr_as_error": false
  }
}

Something less awkward than stderr_as_error would be nice but I can't think of anything haha, maybe the default is:

{
  "name": "app",
  "environment": {
    "DEBUG": "myapp"
  },
  "logs": {
    "levels": {
      "stdout": "info",
      "stderr": "error"
    }
  }
}
@tj

This comment has been minimized.

Copy link
Member

tj commented Jan 31, 2018

oh I know. I'll have this in a few minutes

@tj tj closed this in 50ca137 Jan 31, 2018

@agurtovoy

This comment has been minimized.

Copy link
Author

agurtovoy commented Jan 31, 2018

Awesome, thanks so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.