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 'trace' log level #474

Merged
merged 1 commit into from
Nov 1, 2019
Merged

Add 'trace' log level #474

merged 1 commit into from
Nov 1, 2019

Conversation

tomchristie
Copy link
Member

Adds a new log level, TRACE, which is a level below DEBUG.

Here's why I like this...

INFO Output for stuff such as Process startup, Database connected, Access logs.
Typically suitable for production.

Screenshot 2019-10-31 at 15 04 08

DEBUG Output for stuff such as SQL on database accesses, Outgoing HTTP requests, Cache lookups, SMTP requests, Background tasks.
Really useful during development, without presenting too much info. Everything you'd want to see to get a good idea of what I/O the system is performing on each request.

Screenshot 2019-10-31 at 15 03 06

TRACE ASGI messages & other low level stuff
For when you really need to dig into something obscure, or understand exactly whats happening under the hood.

Screenshot 2019-10-31 at 15 07 28

I can see this fitting in really well as a rule of thumb for other components, too. Eg. I'd like to see httpx issuing one-line-per-request at DEBUG level, or comprehensive logging of state changes at TRACE level. Looking at a web stack as a whole it feels like a natural split to me.

@tomchristie
Copy link
Member Author

Somewhat related: encode/databases#156

@tomchristie tomchristie merged commit 608866d into master Nov 1, 2019
@tomchristie tomchristie deleted the trace-log-level branch November 1, 2019 10:29
@gvbgduh
Copy link
Member

gvbgduh commented Nov 1, 2019

That's the great idea

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

Successfully merging this pull request may close these issues.

2 participants