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

enable separate log levels for app, framework, canvasapi #9

Open
lsloan opened this issue Feb 9, 2023 · 0 comments
Open

enable separate log levels for app, framework, canvasapi #9

lsloan opened this issue Feb 9, 2023 · 0 comments
Assignees

Comments

@lsloan
Copy link
Member

lsloan commented Feb 9, 2023

Problem

When LOG_LEVEL is set in .env, it applies to the Django framework as well as the application. That means when it is set to DEBUG, a ton of messages are logged by Django. At times, that can be useful. However, other times it's overwhelming and makes finding the app's debugging messages difficult.

Solutions

Establish another log level, perhaps DJANGO_LOG_LEVEL for setting Django's level and keep LOG_LEVEL just for this application.

Similarly, @ssciolla suggested canvasapi-specific log levels (see item № 1) in his code review of #11. Perhaps…

  'loggers': {
      'django': {
          'handlers': ['console'],
          'level': os.getenv('LOG_LEVEL', 'INFO').upper(),
          'propagate': False
      },
      'canvasapi': {
          'handlers': ['console'],
          'level': os.getenv('CANVAS_API_LOG_LEVEL', 'WARN').upper()
      }
  }
@lsloan lsloan self-assigned this Feb 9, 2023
@lsloan lsloan changed the title enable DEBUG logging for app, not for framework enable separate log levels for app, framework, canvasapi May 3, 2023
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

No branches or pull requests

1 participant