Skip to content

Idea: Add alternate request id factory that uses request counter #5

@messa

Description

@messa

The default request id factory returns a random string:

2020-01-15 15:58:47,238  INFO: [req:O5bvIlU] Processing GET / (__main__:hello)
2020-01-15 15:58:47,950  INFO: [req:xtMacpA] Processing GET / (__main__:hello)

Sometimes I feel like adding request counter would be better:

2020-01-15 15:58:47,238  INFO: [req:xtMac0001] Processing GET / (__main__:hello)
2020-01-15 15:58:47,950  INFO: [req:xtMac0002] Processing GET / (__main__:hello)

I want to keep some random string in the request id so it can be better searched in logs.
Also it can help when logging from multiple processes (each having their own counter) to one log file.

Maybe let's provide an alternative request id factory for this and let users configure this one instead of the default request id factory.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions