Browse Source

Various improvements to logging/imports

David Cramer 10 years ago
parent
commit
b5b3d74f1b

+ 8 - 7
src/sentry/conf/server.py

@@ -352,7 +352,9 @@ LOGGING = {
     'disable_existing_loggers': True,
     'handlers': {
         'console': {
-            'class': 'logging.StreamHandler'
+            'level': 'WARNING',
+            'class': 'logging.StreamHandler',
+            'formatter': 'simple',
         },
         'sentry': {
             'level': 'ERROR',
@@ -360,25 +362,24 @@ LOGGING = {
         }
     },
     'formatters': {
+        'simple': {
+            'format': '[%(levelname)s] %(message)s',
+        },
         'client_info': {
-            'format': '%(name)s %(levelname)s %(project_slug)s/%(team_slug)s %(message)s'
-        }
+            'format': '[%(levelname)s] %(project_slug)s/%(team_slug)s %(message)s',
+        },
     },
     'root': {
-        'level': 'WARNING',
         'handlers': ['console', 'sentry'],
     },
     'loggers': {
         'sentry': {
             'level': 'ERROR',
-            'handlers': ['console', 'sentry'],
-            'propagate': False,
         },
         'sentry.coreapi': {
             'formatter': 'client_info',
         },
         'sentry.errors': {
-            'level': 'ERROR',
             'handlers': ['console'],
             'propagate': False,
         },

+ 2 - 0
src/sentry/constants.py

@@ -8,6 +8,8 @@ web-server
 :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
 :license: BSD, see LICENSE for more details.
 """
+from __future__ import absolute_import, print_function
+
 import logging
 import os.path
 

+ 2 - 1
src/sentry/coreapi.py

@@ -8,6 +8,7 @@ sentry.coreapi
 # TODO: We should make the API a class, and UDP/HTTP just inherit from it
 #       This will make it so we can more easily control logging with various
 #       metadata (rather than generic log messages which aren't useful).
+from __future__ import absolute_import, print_function
 
 import base64
 import logging
@@ -34,7 +35,7 @@ from sentry.utils.compat import StringIO
 from sentry.utils.strings import decompress
 
 
-logger = logging.getLogger('sentry.coreapi.errors')
+logger = logging.getLogger('sentry.coreapi')
 
 LOG_LEVEL_REVERSE_MAP = dict((v, k) for k, v in LOG_LEVELS.iteritems())
 

+ 1 - 1
src/sentry/db/models/fields/gzippeddict.py

@@ -6,7 +6,7 @@ sentry.db.models.fields.gzippeddict
 :license: BSD, see LICENSE for more details.
 """
 
-from __future__ import absolute_import
+from __future__ import absolute_import, print_function
 
 import logging
 

+ 1 - 1
src/sentry/db/models/fields/node.py

@@ -6,7 +6,7 @@ sentry.db.models.fields.node
 :license: BSD, see LICENSE for more details.
 """
 
-from __future__ import absolute_import
+from __future__ import absolute_import, print_function
 
 import collections
 import logging

+ 1 - 1
src/sentry/db/models/manager.py

@@ -6,7 +6,7 @@ sentry.db.models.manager
 :license: BSD, see LICENSE for more details.
 """
 
-from __future__ import absolute_import
+from __future__ import absolute_import, print_function
 
 import hashlib
 import logging

+ 3 - 0
src/sentry/event_manager.py

@@ -5,6 +5,7 @@ sentry.event_manager
 :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
 :license: BSD, see LICENSE for more details.
 """
+from __future__ import absolute_import, print_function
 
 import logging
 import six
@@ -25,6 +26,7 @@ from sentry.constants import (
 from sentry.models import Event, EventMapping, Group, GroupHash, Project
 from sentry.plugins import plugins
 from sentry.signals import regression_signal
+from sentry.utils.logging import suppress_exceptions
 from sentry.tasks.index import index_event
 from sentry.tasks.merge import merge_group
 from sentry.tasks.post_process import post_process_group
@@ -202,6 +204,7 @@ class EventManager(object):
 
         return data
 
+    @suppress_exceptions
     @transaction.commit_on_success
     def save(self, project, raw=False):
         # TODO: culprit should default to "most recent" frame in stacktraces when

+ 2 - 0
src/sentry/management/commands/cleanup.py

@@ -5,6 +5,8 @@ sentry.management.commands.cleanup
 :copyright: (c) 2012 by the Sentry Team, see AUTHORS for more details.
 :license: BSD, see LICENSE for more details.
 """
+from __future__ import absolute_import, print_function
+
 from django.core.management.base import BaseCommand
 from optparse import make_option
 

+ 2 - 0
src/sentry/middleware/maintenance.py

@@ -5,6 +5,8 @@ sentry.middleware.maintenance
 :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
 :license: BSD, see LICENSE for more details.
 """
+from __future__ import absolute_import, print_function
+
 import logging
 
 from django.conf import settings

+ 2 - 0
src/sentry/models/group.py

@@ -5,6 +5,8 @@ sentry.models.group
 :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
 :license: BSD, see LICENSE for more details.
 """
+from __future__ import absolute_import, print_function
+
 import logging
 import math
 import time

Some files were not shown because too many files changed in this diff