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

Move sqlx query logging to debug level #1128

Merged
merged 1 commit into from
Jun 18, 2024
Merged

Commits on Jun 18, 2024

  1. Move sqlx query logging to debug level

    By default, `sea_orm::ConnectOptions` will log queries at info ([1]). As
    a result, `divviup-api` logs are filled with unhelpful lines like:
    
    ```json
    {
        "timestamp": "2024-06-18T21:31:41.294043Z",
        "level": "INFO",
        "fields": {
            "summary": "select 1",
            "db.statement": "",
            "rows_affected": 1,
            "rows_returned": 1,
            "elapsed": "171.873\u00b5s"
        },
        "target": "sqlx::query",
        "filename": "/usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-core-0.7.3/src/logger.rs",
        "line_number": 135,
        "threadId": "ThreadId(4)"
    }
    ```
    
    ...which is just the healthcheck succeeding. This commit moves that
    logging to debug level, so that we can still opt into it but generate
    less noise in normal operation.
    
    [1]: https://docs.rs/sea-orm/0.12.15/sea_orm/struct.ConnectOptions.html#method.sqlx_logging_level
    tgeoghegan committed Jun 18, 2024
    Configuration menu
    Copy the full SHA
    e4421e1 View commit details
    Browse the repository at this point in the history