You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2018/02/22 22:10:38 UTC
[airavata-django-portal] 02/02: Adding upload error logging,
logging config
This is an automated email from the ASF dual-hosted git repository.
machristie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git
commit ffd38ba8aa12df62d923579c197a1db1ad494790
Author: Marcus Christie <ma...@iu.edu>
AuthorDate: Thu Feb 22 17:10:29 2018 -0500
Adding upload error logging, logging config
---
django_airavata/apps/api/views.py | 1 +
django_airavata/settings_local.py.sample | 43 ++++++++++++++++++++++++++++++++
2 files changed, 44 insertions(+)
diff --git a/django_airavata/apps/api/views.py b/django_airavata/apps/api/views.py
index 971be73..d0ce7ef 100644
--- a/django_airavata/apps/api/views.py
+++ b/django_airavata/apps/api/views.py
@@ -648,6 +648,7 @@ def upload_input_file(request):
return JsonResponse({'uploaded': True,
'data-product-uri': data_product_uri})
except Exception as e:
+ log.error("Failed to upload file", exc_info=True)
resp = JsonResponse({'uploaded': False, 'error': str(e)})
resp.status_code = 500
return resp
diff --git a/django_airavata/settings_local.py.sample b/django_airavata/settings_local.py.sample
index 38c3149..fcea7b2 100644
--- a/django_airavata/settings_local.py.sample
+++ b/django_airavata/settings_local.py.sample
@@ -45,3 +45,46 @@ PROFILE_SERVICE_SECURE = False
SHARING_API_HOST = 'localhost'
SHARING_API_PORT = 7878
SHARING_API_SECURE = False
+
+# Logging configuration
+# LOGGING = {
+# 'version': 1,
+# 'disable_existing_loggers': False,
+# 'formatters': {
+# 'verbose': {
+# 'format': '[%(asctime)s %(name)s:%(lineno)d %(levelname)s] %(message)s'
+# },
+# },
+# 'filters': {
+# 'require_debug_true': {
+# '()': 'django.utils.log.RequireDebugTrue',
+# },
+# },
+# 'handlers': {
+# 'console': {
+# 'filters': ['require_debug_true'],
+# 'class': 'logging.StreamHandler',
+# 'formatter': 'verbose',
+# 'level': 'DEBUG',
+# },
+# 'file': {
+# 'class': 'logging.FileHandler',
+# 'filename': 'django_airavata.log',
+# 'formatter': 'verbose',
+# },
+# },
+# 'loggers': {
+# 'django': {
+# 'handlers': ['console', 'file'],
+# 'level': os.getenv('DJANGO_LOG_LEVEL', 'INFO'),
+# },
+# 'airavata': {
+# 'handlers': ['console', 'file'],
+# 'level': 'DEBUG',
+# },
+# 'django_airavata': {
+# 'handlers': ['console', 'file'],
+# 'level': 'DEBUG',
+# },
+# },
+# }
--
To stop receiving notification emails like this one, please contact
machristie@apache.org.