Beispiel #1
0
    def generate_id():
        # Try use hashed machine identifier
        try:
            return md5(Environment.platform.machine_identifier)
        except Exception as ex:
            log.warn('Unable to generate id from machine identifier - %s', ex, exc_info=True)

        # Try use hashed hostname
        try:
            return md5(gethostname().encode('utf-8'))
        except Exception as ex:
            log.warn('Unable to generate id from hostname - %s', ex, exc_info=True)

        # Fallback to random identifier
        return md5(str(uuid.uuid4()))
Beispiel #2
0
    def generate_id():
        # Try use hashed machine identifier
        try:
            return md5(Environment.platform.machine_identifier)
        except Exception as ex:
            log.warn('Unable to generate id from machine identifier - %s',
                     ex,
                     exc_info=True)

        # Try use hashed hostname
        try:
            return md5(gethostname().encode('utf-8'))
        except Exception as ex:
            log.warn('Unable to generate id from hostname - %s',
                     ex,
                     exc_info=True)

        # Fallback to generated identifier
        return 'generated-' + md5(str(uuid.uuid4()))
Beispiel #3
0
import os
import os.path

from raven.utils import gethostname

ROOT = os.path.normpath(os.path.join(os.path.dirname(__file__), os.pardir))

TIMEOUT = 1

# TODO: this is specific to Django
CLIENT = 'raven.contrib.django.DjangoClient'

# Not all environments have access to socket module, for example Google App Engine
# Need to check to see if the socket module has ``gethostname``, if it doesn't we
# will set it to None and require it passed in to ``Client`` on initializtion.
NAME = gethostname()

# The maximum number of elements to store for a list-like structure.
MAX_LENGTH_LIST = 50

# The maximum length to store of a string-like structure.
MAX_LENGTH_STRING = 400

# Automatically log frame stacks from all ``logging`` messages.
AUTO_LOG_STACKS = False

# Collect locals variables
CAPTURE_LOCALS = True

# Client-side data processors to apply
PROCESSORS = ('raven.processors.SanitizePasswordsProcessor', )
Beispiel #4
0
            logger.warn('[%s] %s' % (category.__name__, message))

        warnings.showwarning = callback

    @staticmethod
    def generate_id():
        # Try use hashed machine identifier
        try:
            return md5(Environment.platform.machine_identifier)
        except Exception, ex:
            log.warn('Unable to generate id from machine identifier - %s', ex, exc_info=True)

        # Try use hashed hostname
        try:
            return md5(gethostname().encode('utf-8'))
        except Exception, ex:
            log.warn('Unable to generate id from hostname - %s', ex, exc_info=True)

        # Fallback to random identifier
        return md5(str(uuid.uuid4()))

    @classmethod
    def refresh(cls):
        for name, option in LOG_OPTIONS.items():
            logger = logging.getLogger(name)

            # Retrieve logger level, check if it has changed
            level = cls.get_level(option)

            if level == logger.level:
from raven.utils import gethostname

ROOT = os.path.normpath(os.path.join(os.path.dirname(__file__), os.pardir))

# This should be the full URL to sentries store view
SERVERS = None

TIMEOUT = 1

# TODO: this is specific to Django
CLIENT = 'raven.contrib.django.DjangoClient'

# Not all environments have access to socket module, for example Google App Engine
# Need to check to see if the socket module has ``gethostname``, if it doesn't we
# will set it to None and require it passed in to ``Client`` on initializtion.
NAME = gethostname()

# Superuser key -- will be used if set, otherwise defers to
# SECRET_KEY and PUBLIC_KEY
KEY = None

# Credentials to authenticate with the Sentry server
SECRET_KEY = None
PUBLIC_KEY = None

# We allow setting the site name either by explicitly setting it with the
# SENTRY_SITE setting, or using the django.contrib.sites framework for
# fetching the current site. Since we can't reliably query the database
# from this module, the specific logic is within the SiteFilter
SITE = None