web/ldtplatform/config.py.tmpl
changeset 858 dcf47b385ddd
parent 769 a49769a3088d
child 905 7be50692abb4
equal deleted inserted replaced
857:3fc0960ae97b 858:dcf47b385ddd
    61 TEMPLATE_DEBUG = DEBUG
    61 TEMPLATE_DEBUG = DEBUG
    62 
    62 
    63 #LOG_FILE = os.path.abspath(os.path.join(BASE_DIR,"../log/log.txt"))
    63 #LOG_FILE = os.path.abspath(os.path.join(BASE_DIR,"../log/log.txt"))
    64 LOG_FILE = '%(log_file)s'
    64 LOG_FILE = '%(log_file)s'
    65 LOG_LEVEL = logging.DEBUG
    65 LOG_LEVEL = logging.DEBUG
    66 logging.basicConfig(filename=LOG_FILE, level=LOG_LEVEL)
    66 LOGGING = {
       
    67     'version': 1,
       
    68     'disable_existing_loggers': False,
       
    69     'formatters' : {
       
    70         'simple' : {
       
    71             'format': "%(asctime)s - %(levelname)s : %(message)s",
       
    72         },
       
    73         'semi-verbose': {
       
    74             'format': '%(levelname)s %(asctime)s %(module)s %(message)s'
       
    75         },                    
       
    76     },
       
    77     'handlers': {
       
    78         'mail_admins': {
       
    79             'level': 'ERROR',
       
    80             'class': 'django.utils.log.AdminEmailHandler'
       
    81         },
       
    82         'stream_to_console': {
       
    83             'level': LOG_LEVEL,
       
    84             'class': 'logging.StreamHandler'
       
    85         },
       
    86         'file': {
       
    87             'level': LOG_LEVEL,
       
    88             'class': 'logging.FileHandler',
       
    89             'filename': LOG_FILE,
       
    90             'formatter': 'semi-verbose',
       
    91         },
       
    92     },
       
    93     'loggers': {
       
    94         'django.db.backends':{
       
    95             'handlers': ['file'],
       
    96             'level': LOG_LEVEL,
       
    97             'propagate': True,
       
    98         },                
       
    99         'django.request': {
       
   100             'handlers': ['file'],
       
   101             'level': LOG_LEVEL,
       
   102             'propagate': True,
       
   103         },
       
   104         'ldt': {
       
   105             'handlers': ['file'],
       
   106             'level': LOG_LEVEL,
       
   107             'propagate': True,
       
   108         },
       
   109     }
       
   110 }
    67 
   111 
    68 
   112 
    69 ADMINS = (
   113 ADMINS = (
    70     # ('Your Name', 'your_email@domain.com'),
   114     # ('Your Name', 'your_email@domain.com'),
    71 )
   115 )