Permalink
Browse files

cleanup logging

  • Loading branch information...
ianedwardthomas committed Mar 10, 2016
1 parent bdbf312 commit ab15a9ef1fd09b11db9b65243ee4989b0e90117c
Showing with 105 additions and 84 deletions.
  1. +2 −2 LICENSE.txt
  2. +3 −3 chiminey/initialisation/chimineyinitial.py
  3. +100 −79 chiminey/settings_changeme.py
View
@@ -1,4 +1,4 @@
Copyright (C) 2014, RMIT University
Copyright (C) 2016, RMIT University
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction,
@@ -19,4 +19,4 @@ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -231,12 +231,12 @@ def _get_chiminey_schemas():
'help_text': 'The unique identifier of the platform name'},
u'ip_address': {'type': models.ParameterName.STRING, 'subtype': '',
'description': 'IP address or Hostname', 'ranking': 15,
'help_text': 'Hostname or IP address of the computation platform. For cluster, it is the ip address or hostname of the head node.'},
'help_text': 'IP address of the jenkins server.'},
u'username': {'type': models.ParameterName.STRING, 'subtype': '', 'description': 'Username',
'ranking': 20, 'help_text': 'Username of the account holder.'},
'ranking': 20, 'help_text': 'Username of the jenkins account.'},
u'password': {'type': models.ParameterName.STRING, 'subtype': 'password',
'description': 'Password', 'ranking': 22,
'help_text': 'Password of the account holder. Password is not stored in the Chiminey server. It is temporarily kept in memory to to establish a private/public key authentication from the Chiminey server to the cluster/unix platform.'},
'help_text': 'Password of the account holder.'},
# u'home_path': {'type': models.ParameterName.STRING, 'subtype': '', 'description': 'Home path',
# 'ranking': 24,
# 'help_text': 'Home directory. This is the location where .ssh directory resides. The home path is needed to store a Chiminey-specific public key on the cluster/unix server.'},
@@ -1,5 +1,7 @@
import djcelery
import sys
import os
from datetime import timedelta
DEBUG = True
@@ -214,97 +216,116 @@ def get_admin_media_path():
#print '\n'.join(INSTALLED_APPS)
LOGGER_LEVEL = "DEBUG"
LOGGER_LEVEL = os.environ.get('LOGGER_LEVEL', 'WARN')
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'timestamped': {
'format': ' [%(asctime)s: %(levelname)s/%(processName)s] %(message)s'
# 'format': '%(asctime)s-%(filename)s-%(lineno)s-%(levelname)s: %(message)s'
# 'format': '%(asctime)s-%(filename)s-%(lineno)s-%(levelname)s: %(message)s'
},
},
'handlers': {
'file': {
'class': 'logging.handlers.FileHandler',
# 'class': 'logging.handlers.RotatingFileHandler',
'filename': '/logs/chiminey.log',
'formatter': 'timestamped',
'maxBytes': 1024 * 1024 * 100, # 100 mb
'backupCount': 2
'default': {
'class':'logging.StreamHandler',
'formatter': 'timestamped'
},
'file': {
'class': 'logging.FileHandler',
'filename': os.path.join("/logs", os.environ.get('CHIMINEY_LOG_FILE', 'chiminey.log')),
'formatter': 'timestamped',
# 'maxBytes': 1024 * 1024 * 100, # 100 mb
# 'backupCount': 4
},
'rotatingfile': {
'class': 'logging.handlers.RotatingFileHandler',
'filename': os.path.join("/logs", os.environ.get('CHIMINEY_LOG_FILE', 'chiminey.log')),
'formatter': 'timestamped',
'maxBytes': 1024 * 1024 * 100, # 100 mb
'backupCount': 4
},
},
'loggers': {
# 'chiminey': {
# 'level': LOGGER_LEVEL,
# #'handlers': ['file'],
# },
'chiminey.smartconnectorscheduler': {
'level': LOGGER_LEVEL,
#'handlers': ['file'],
},
'chiminey.sshconnection': {
'level': LOGGER_LEVEL,
#'handlers': ['file'],
},
'chiminey.platform': {
'level': LOGGER_LEVEL,
#'handlers': ['file'],
},
'chiminey.cloudconnection': {
'level': LOGGER_LEVEL,
#'handlers': ['file'],
},
'chiminey.reliabilityframework': {
'level': LOGGER_LEVEL,
#'handlers': ['file'],
},
'chiminey.simpleui': {
'level': LOGGER_LEVEL,
#'handlers': ['file'],
},
'chiminey.mytardis': {
'level': LOGGER_LEVEL,
#'handlers': ['file'],
},
'chiminey.simpleui.wizard': {
'level': LOGGER_LEVEL,
#'handlers': ['file'],
},
'chiminey.storage': {
'level': LOGGER_LEVEL,
#'handlers': ['file'],
},
'chiminey.sshconnector': {
'level': LOGGER_LEVEL,
#'handlers': ['file'],
},
'chiminey.core': {
'level': LOGGER_LEVEL,
#'handlers': ['file'],
},
# 'chiminey.smartconnectorscheduler.tasks': {
# 'level': LOGGER_LEVEL,
# #'handlers': ['file'],
# },
'celery.task': {
'level': 'ERROR',
#'handlers': ['file'],
},
'django.db.backends': {
'level': 'ERROR',
#'handlers': ['file'],
},
'south': {
'level': LOGGER_LEVEL,
#'handlers': ['file'],
},
'loggers': {
'chiminey': {
'level': LOGGER_LEVEL,
'handlers': ['default'],
},
'chiminey.smartconnectorscheduler': {
'level': LOGGER_LEVEL,
'handlers': ['default'],
},
'chiminey.sshconnection': {
'level': LOGGER_LEVEL,
'handlers': ['default'],
},
'chiminey.platform': {
'level': LOGGER_LEVEL,
'handlers': ['default'],
},
'chiminey.cloudconnection': {
'level': LOGGER_LEVEL,
'handlers': ['default'],
},
'chiminey.reliabilityframework': {
'level': LOGGER_LEVEL,
'handlers': ['default'],
},
'chiminey.simpleui': {
'level': LOGGER_LEVEL,
'handlers': ['default'],
},
'chiminey.mytardis': {
'level': LOGGER_LEVEL,
'handlers': ['default'],
},
'chiminey.simpleui.wizard': {
'level': LOGGER_LEVEL,
'handlers': ['default'],
},
'chiminey.storage': {
'level': LOGGER_LEVEL,
'handlers': ['default'],
},
'chiminey.sshconnector': {
'level': LOGGER_LEVEL,
'handlers': ['default'],
},
'chiminey.core': {
'level': LOGGER_LEVEL,
'handlers': ['default'],
},
'chiminey.smartconnectorscheduler.tasks': {
'level': 'INFO',
'handlers': ['default'],
},
'celery.task': {
'level': 'ERROR',
'handlers': ['default'],
},
'django.db.backends': {
'level': 'ERROR',
'handlers': ['default'],
},
'south': {
'level': LOGGER_LEVEL,
'handlers': ['default'],
},
}
}
}
TASTYPIE_DEFAULT_FORMATS = ['json']
@@ -413,9 +434,9 @@ def get_admin_media_path():
'chiminey.platform.cloud.CloudPlatform',
'chiminey.platform.jenkins.JenkinsPlatform',
'chiminey.platform.mytardis.MyTardisPlatform',
)
)
from pprint import pformat
print pformat(LOGGING)
djcelery.setup_loader()
djcelery.setup_loader()

0 comments on commit ab15a9e

Please sign in to comment.