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

App exceptions should be logged to aid support investigations #432

Closed
osg74 opened this issue Jan 23, 2014 · 7 comments
Closed

App exceptions should be logged to aid support investigations #432

osg74 opened this issue Jan 23, 2014 · 7 comments
Assignees

Comments

@osg74
Copy link

osg74 commented Jan 23, 2014

Currently if an exception occurs on the live RSR server this isn't logged in the RSR log file, which makes investigating failures and configuration problems more difficult. Any unhandled exceptions should be logged, even when RSR isn't running in debug mode.

@adriancollier
Copy link
Contributor

@osgl do you know what's required for this one? Is this something @carlio would need to do, or something more general to Django?

@osg74
Copy link
Author

osg74 commented Mar 25, 2014

This is error handling and reporting that RSR developers would need to add to the codebase so that we have something to work with from an Ops perspective when something falls over. Currently we only seem to have the raw HTTP traffic logged in our nginx logs but nothing in the RSR web app log itself (other than some very minor debug info that seems to be obsolete anyway).

For example, wherever we've previously had warnings of a 'server error' during RSR execution (and we've subsequently seen a traceback when debug mode is enabled), this indicates an unhandled exception. Developers should either be coding to fix such errors or provide sufficient log file commentary so that we can diagnose and resolve any configuration or operational issues quickly enough.

@osg74
Copy link
Author

osg74 commented Mar 25, 2014

Here's a good article about coding useful exception handling and esp. how to write meaningful exception messages to quickly diagnose and resolve support issues: http://programmers.stackexchange.com/questions/29433/how-to-write-a-good-exception-message

The point is really that 5 min of coding time to write decent error handling will save 2 hours of wasted ops time trying to find out why something is broken.

zzgvh added a commit that referenced this issue Apr 10, 2014
In 10-base.conf:
  Add ExceptionLoggingMiddleware to MIDDLEWARE_CLASSES

  Create settings for the paths to and names of the logging files,
  akvo.log and akvo.error.log. LOG_FILE_PATH is now set to the "default"
  path used in the vagrant setup.

  Remove LOGGING

In 90-finish.conf:
  Add ACCESS_LOG_FILE_FULL_NAME and ERROR_LOG_FILE_FULL_NAME

  Edit LOGGING to support the new exception handling middleware logger

  Also some cleanup of the LOGGING setting. It will need more work when
  we start using logging more in earnest.
@zzgvh
Copy link
Contributor

zzgvh commented Apr 10, 2014

Bah, missed a #. Here's the other commit related to this: 5ec2276

@adriancollier
Copy link
Contributor

@zzgvh If this is done - can we create a pull request for checking?

@KasperBrandt
Copy link
Contributor

Merged in #536

@KasperBrandt
Copy link
Contributor

Test plan

GIVEN RSR
WHEN an error occurs
THEN the stack trace should be logged in /var/akvo/rsr/logs/akvo.error.log.

@MichaelAkvo MichaelAkvo moved this to Done in RSR Dec 8, 2022
@MichaelAkvo MichaelAkvo added this to RSR Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

5 participants