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 support for multiple log formats #517

Merged

Conversation

sebastianwebber
Copy link
Contributor

@sebastianwebber sebastianwebber commented Jul 19, 2023

this commit adds the tracing-subscriber crate and use its formatters to support multiple log formats.

More details in #464 (comment)

Related with #464

it adds a new arg in the cmd:

PgCat: Nextgen PostgreSQL Pooler

Usage: pgcat [OPTIONS] [CONFIG_FILE]

Arguments:
  [CONFIG_FILE]  [env: CONFIG_FILE=] [default: pgcat.toml]

Options:
  -l, --log-level <LOG_LEVEL>    [env: LOG_LEVEL=] [default: INFO]
  -F, --log-format <LOG_FORMAT>  [env: LOG_FORMAT=] [default: text] [possible values: text, structured, debug]
  -h, --help                     Print help
  -V, --version                  Print version

@sebastianwebber sebastianwebber changed the title add support for multiple log format add support for multiple log formats Jul 19, 2023
@sebastianwebber sebastianwebber force-pushed the sebastian/add-cmd-option-to-log-format branch from 74891a9 to 899dcc7 Compare July 19, 2023 05:43
this commit adds the tracing-subscriber crate and use its formatters to
support multiple log formats.

More details in
postgresml#464 (comment)

Signed-off-by: Sebastian Webber <[email protected]>
@sebastianwebber sebastianwebber force-pushed the sebastian/add-cmd-option-to-log-format branch from 899dcc7 to 1a937e1 Compare July 19, 2023 05:49
@sebastianwebber
Copy link
Contributor Author

ok, it's tests passed. let me know if there is anything else to change.

@levkk
Copy link
Contributor

levkk commented Jul 19, 2023

Nice, this is awesome, thank you!

@levkk levkk merged commit f85e5bd into postgresml:main Jul 19, 2023
@Spindel
Copy link
Contributor

Spindel commented Jul 27, 2023

Due to fun reasons I just discovered that this PR does not update the documentation in README.md that documents how to set the log levels using RUST_LOG.

It would also be Very nice if the tracin subscriber could add the env filter and initialize it by default, but that seems like an separate issue.

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.

3 participants