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

Plugins logs are not controlled by the --verbosity flag #3189

Closed
kichristensen opened this issue Jul 13, 2024 · 0 comments · Fixed by #3185
Closed

Plugins logs are not controlled by the --verbosity flag #3189

kichristensen opened this issue Jul 13, 2024 · 0 comments · Fixed by #3185
Assignees
Labels
bug Oops, sorry!

Comments

@kichristensen
Copy link
Contributor

Describe the bug

Plugins log level are not controlled by the --verbosity flag, instead it is controlled by the log files log level, e.g., PORTER_LOGS_LEVEL. In all other places the console log level, is controlled by the verbosity, and the code explicitly states that log file level should only affect the log level of the log file.

To Reproduce

Steps to reproduce the behavior:

  1. Ensure that mongo:4.0-xenial is NOT pulled
  2. Run this porter command porter list --verbosity debug
  3. See that the output doesn't contain the debug log, "pulling mongo:4.0-xenial", written by the plugin
  4. Delete the mongo:4.0-xenial image in Docker
  5. Run this porter command PORTER_LOGS_LEVEL=debug porter list --verbosity debug
  6. See that the output now contains the debug log, "pulling mongo:4.0-xenial", written by the plugin

Expected behavior

Plugins log level should be controlled by --verbosity instead of log file log level.

Porter Command and Output

2024-07-13T23:08:19.432+0200    debug   Checking database schema
2024-07-13T23:08:19.432+0200    debug   Selected configured plugin      {"plugin-key": "mongodb-docker"}
2024-07-13T23:08:19.433+0200    debug   Connecting to plugin    {"plugin-command": "/home/kim/.porter/porter plugin run storage.porter.mongodb-docker"}
2024-07-13T23:08:19.433+0200    debug   starting plugin
2024-07-13T23:08:19.435+0200    debug   plugin started
2024-07-13T23:08:19.435+0200    debug   waiting for RPC address
2024-07-13T23:08:19.452+0200    debug   using plugin
2024-07-13T23:08:19.452+0200    debug   plugin address
2024-07-13T23:08:44.966+0200    debug   Initializing installation collection indices
2024-07-13T23:08:44.969+0200    debug   Initializing parameter collection indices
2024-07-13T23:08:44.969+0200    debug   Initializing credentials collection indices
-----------------------------------------------------
  NAMESPACE  NAME  VERSION  STATE  STATUS  MODIFIED
-----------------------------------------------------
2024-07-13T23:08:44.974+0200    debug   received EOF, stopping recv loop
2024-07-13T23:08:44.975+0200    debug   plugin process exited
2024-07-13T23:08:44.975+0200    debug   plugin exited
PORTER_LOGS_STRUCTURED=true PORTER_LOGS_LEVEL=debug porter list --verbosity debug
2024-07-13T23:02:59.799+0200    debug   Checking database schema
2024-07-13T23:02:59.799+0200    debug   Selected configured plugin      {"plugin-key": "mongodb-docker"}
2024-07-13T23:02:59.799+0200    debug   Connecting to plugin    {"plugin-command": "/home/kim/.porter/porter plugin run storage.porter.mongodb-docker"}
2024-07-13T23:02:59.799+0200    debug   starting plugin
2024-07-13T23:02:59.799+0200    debug   plugin started
2024-07-13T23:02:59.800+0200    debug   waiting for RPC address
2024-07-13T23:02:59.818+0200    debug   using plugin
2024-07-13T23:02:59.818+0200    debug   plugin address
2024-07-13T23:02:59.879+0200    debug   pulling mongo:4.0-xenial
2024-07-13T23:03:19.308+0200    debug   running a mongo server in a container on port 27018
2024-07-13T23:03:19.308+0200    debug   waiting for the mongo service to be ready
2024-07-13T23:03:25.172+0200    debug   Initializing installation collection indices
2024-07-13T23:03:25.174+0200    debug   Initializing parameter collection indices
2024-07-13T23:03:25.175+0200    debug   Initializing credentials collection indices
-----------------------------------------------------
  NAMESPACE  NAME  VERSION  STATE  STATUS  MODIFIED
-----------------------------------------------------
2024-07-13T23:03:25.182+0200    debug   received EOF, stopping recv loop
2024-07-13T23:03:25.184+0200    debug   plugin process exited
2024-07-13T23:03:25.184+0200    debug   plugin exited

Version

porter v1.1.0 (b50c189)

@kichristensen kichristensen added the bug Oops, sorry! label Jul 13, 2024
@kichristensen kichristensen self-assigned this Jul 13, 2024
@kichristensen kichristensen linked a pull request Jul 13, 2024 that will close this issue
4 tasks
@github-project-automation github-project-automation bot moved this from In Progress to Done in Porter v1.2.0 (November 2024) Aug 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Oops, sorry!
Projects
Development

Successfully merging a pull request may close this issue.

1 participant