-
Notifications
You must be signed in to change notification settings - Fork 20
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
Use mozlog for application logging #21
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a line demonstrating it's usage in one of the api methods?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requires a rebase do the requirements.txt refactor.
Configure the application to use the mozlog structured log format for application-level log messages (log messages from libraries and frameworks still go through the Python Standard Library string logger).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 nit which I don't mind fixing in another commit.
landoapi/transplant_client.py
Outdated
ldap_username, | ||
'msg': | ||
'received an empty response from the transplant service', | ||
}, 'transplant.failure' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at the end of this line you can add a comment like: # yapf: disable
to prevent the linter from formating this hash. I don't think this is good style just because the linter says so, it's clearly a bug and we know better :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do
Configure the application to use the mozlog structured log format for
application-level log messages (log messages from libraries and
frameworks still go through the Python Standard Library string logger).
To test, modify
docker-compose.override.yml
and set theLOG_LEVEL
environment variable to the string valuedebug
. A message about logging initialization should appear in the container logs.Try setting the
LOG_LEVEL
value tofoobar
to see what happens if an unknown/typo'd log level is set.