~chipaca/unity-lens-video/custom-user-agent

« back to all changes in this revision

Viewing changes to settings.py.sample

  • Committer: Janos Gyerik
  • Date: 2012-05-21 18:31:58 UTC
  • Revision ID: janos@axiom-20120521183158-kvtqzuo6yhe3mdzq
added example configuration for logging to file

Show diffs side-by-side

added added

removed removed

Lines of Context:
147
147
# the site admins on every HTTP 500 error.
148
148
# See http://docs.djangoproject.com/en/dev/topics/logging for
149
149
# more details on how to customize your logging configuration.
 
150
#
 
151
# Example usage:
 
152
# import logging
 
153
# logger = logging.getLogger(__name__)
 
154
# logger.debug('something happened')
150
155
LOGGING = {
151
156
    'version': 1,
152
157
    'disable_existing_loggers': False,
 
158
    'formatters': {
 
159
        'verbose': {
 
160
            'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s',
 
161
        },
 
162
        'simple': {
 
163
            'format': '%(levelname)s %(asctime)s %(module)s %(message)s',
 
164
        },
 
165
    },
153
166
    'handlers': {
154
167
        'mail_admins': {
155
168
            'level': 'ERROR',
156
169
            'class': 'django.utils.log.AdminEmailHandler'
157
 
        }
 
170
        },
 
171
        'file': {
 
172
            'level': 'DEBUG',
 
173
            'class': 'logging.FileHandler',
 
174
            'filename': 'debug.log',
 
175
            'formatter': 'simple',
 
176
        },
158
177
    },
159
178
    'loggers': {
160
179
        'django.request': {
162
181
            'level': 'ERROR',
163
182
            'propagate': True,
164
183
        },
 
184
        'oneliners': {
 
185
            'handlers': ['file'],
 
186
            'level': 'DEBUG',
 
187
        },
165
188
    }
166
189
}
167
190