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

Disable database driver logging or restrict to debug-level only #9

Open
atc0005 opened this issue Sep 25, 2020 · 1 comment
Open

Disable database driver logging or restrict to debug-level only #9

atc0005 opened this issue Sep 25, 2020 · 1 comment
Assignees
Milestone

Comments

@atc0005
Copy link
Owner

atc0005 commented Sep 25, 2020

Current logging from a pre-v0.1.0 build:

  INFO[0000] mysql2sqlite dev build (https://github.com/atc0005/mysql2sqlite)
  INFO[0000] Connection established to database server at 127.0.0.1:3306
  INFO[0000] Connection established to SQLite database at /var/cache/mysql2sqlite/mailserver.db
  WARN[0000] Fake delay in order to allow for destruction
  INFO[0010] Successfully copied 4 rows from source database table transport_maps
  WARN[0010] Fake delay in order to allow for destruction
[mysql] 2020/09/25 10:33:25 packets.go:122: closing bad idle connection: unexpected read from socket
[mysql] 2020/09/25 10:33:25 connection.go:158: driver: bad connection
  WARN[0020] Transaction rollback complete
 FATAL[0020] failed to prepare row count statement for table access_check_senders: dial tcp 127.0.0.1:3306: connect: connection refused

These lines are useful, but unexpected:

[mysql] 2020/09/25 10:33:25 packets.go:122: closing bad idle connection: unexpected read from socket
[mysql] 2020/09/25 10:33:25 connection.go:158: driver: bad connection

Does the driver offer a way to toggle that output? This output is specific to MySQL, but the concern applies to any database connection used by this application.

@atc0005 atc0005 added this to the Future milestone Sep 25, 2020
@atc0005 atc0005 self-assigned this Sep 25, 2020
@atc0005
Copy link
Owner Author

atc0005 commented Sep 27, 2020

I'm in favor of toggling this on/off via a config file option.

GH-20 would have been easier to debug if I would have had an option wired in to enable debug logging from the MySQL driver. Presumably it would have emitted a warning or debug level message that would have confirmed that I was hitting the configured max connections limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant