# See http://docs.djangoproject.com/en/dev/topics/logging for
# more details on how to customize your logging configuration.
LOGGING = {
- 'version': 1,
- 'disable_existing_loggers': False,
- 'formatters': {
- 'simple': {
- 'format': "%(asctime)s - %(levelname)s - %(name)s %(message)s"
- }
- },
- 'handlers': {
- 'log_file': {
- 'class': 'logging.handlers.WatchedFileHandler',
- 'filename':
- # FIXME: populate configuration like log path from up in
- # the C++ layer where we have our ceph config_opts
- "/tmp/pyfoo.log",
- 'formatter': 'simple'
- },
- },
- 'loggers': {
- 'django.request': {
- 'handlers': ['log_file'],
- # FIXME: populate log level from C++-land configuration
- 'level': "DEBUG",
- 'propagate': True,
- },
- }
+
}
self._handle = handle
self._logger = logging.getLogger(handle)
+ # FIXME: we should learn the log level from C++ land, and then
+ # avoid calling ceph_state.log when we know a message is of
+ # an insufficient level to be ultimately output
+
class CPlusPlusHandler(logging.Handler):
def emit(self, record):
if record.levelno <= logging.DEBUG:
# class definition
log = self.log
+ # Configure django.request logger
+ logging.getLogger("django.request").handlers = self.log.handlers
+ logging.getLogger("django.request").setLevel(logging.DEBUG)
+
class APIKeyAuthentication(authentication.BaseAuthentication):
def authenticate(self, request):
if not global_instance().enable_auth: