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
Add error logging to project #43
Conversation
tagging_tracker/settings.py
Outdated
}, | ||
'file': { | ||
'class': 'logging.FileHandler', | ||
'filename': '/logs/error.log' |
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.
Does this need to have the prefix /code/
path?
tagging_tracker/settings.py
Outdated
'loggers': { | ||
'': { # 'catch all' loggers by referencing it with the empty string | ||
'handlers': ['console', 'file'], | ||
'level': 'DEBUG', |
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 use the variable debug above?
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.
if DEBUG is true, set to 'DEBUG' else, set to info?
https://github.com/codeforkansascity/tagging_tracker_backend/pull/43/files#diff-5fbc47b4c304f27a99656b4293e9c029R23
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.
I think that when we launch this, we would want the error logging on the server so we can have some insight if something goes wrong. If you want me to change that, I can.
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.
Okay, I'll add a logging level configuration.
It is difficult to debug an application that does not produce any erorr logging. Add error logging to project through an error file and console output. Signed-off-by: Frederick Lawler <fred@fredlawl.com>
Developers should be able to configure their log level for development. Add a note to the README with updated documentation concerning the new setting, and add the setting to the settings.py file with a default of ERROR if unspecified. Signed-off-by: Frederick Lawler <fred@fredlawl.com>
d41e6f1 ("Merge pull request codeforkansascity#43 from fredlawl/issue-42") addressed an issue where there was need to have error logging in the project. A bug was introduced such that the log directory did not exists when Django operations are ran via ssh-ing into the container. This problem also exists for people who perform operations without the Docker build process. Fix this by adding in a logs directory into the project root, and modify the Docker startup script to create the files/directories before Django build processes runs. Signed-off-by: Frederick Lawler <fred@fredlawl.com>
d41e6f1 ("Merge pull request codeforkansascity#43 from fredlawl/issue-42") addressed an issue where there was need to have error logging in the project. A bug was introduced such that the log directory did not exists when Django operations are ran via ssh-ing into the container. This problem also exists for people who perform operations without the Docker build process. Fix this by adding in a logs directory into the project root, and modify the Docker startup script to create the files/directories before Django build processes runs. Signed-off-by: Frederick Lawler <fred@fredlawl.com>
d41e6f1 ("Merge pull request #43 from fredlawl/issue-42") addressed an issue where there was need to have error logging in the project. A bug was introduced such that the log directory did not exists when Django operations are ran via ssh-ing into the container. This problem also exists for people who perform operations without the Docker build process. Fix this by adding in a logs directory into the project root, and modify the Docker startup script to create the files/directories before Django build processes runs. Signed-off-by: Frederick Lawler <fred@fredlawl.com>
It is difficult to debug an application that does not produce any erorr
logging. Add error logging to project through an error file and
console output.
Signed-off-by: Frederick Lawler fred@fredlawl.com