Commit Graph

55 Commits

Author SHA1 Message Date
David Cramer 86f7c1065b Correctly accept kwargs with only dsn argument (fixes GH-460) 2014-06-06 06:21:29 -07:00
David Cramer b9bd240a79 Merge branch 'raise_send_errors' of https://github.com/richg/raven-python into richg-raise_send_errors
Conflicts:
	raven/base.py
	raven/contrib/django/client.py
	raven/handlers/logbook.py
	raven/handlers/logging.py
	tests/handlers/logging/tests.py
2014-05-22 00:25:46 -07:00
David Cramer 39c65bf8b5 Update interfaces to use protocol 5/aliases 2014-05-20 12:02:18 -07:00
Sergio Oliveira ce7da4c08c Allowing to configure server_name using logging 2014-03-20 20:22:25 -03:00
Matt Robenolt 4d017bcdad Optimize logging handler by making RESERVED a set instead of a tuple 2014-02-20 20:09:05 -08:00
Rory Geoghegan 025f358b12 Fixed bug in logging.py where messages were not being printed to stderr.
Also took the opportunity to port the print statments in logbook.py to
python3.
2013-11-04 12:45:41 -05:00
Andre Eriksson db54baf29a Don't ignore records for all modules starting with "raven" 2013-10-01 10:34:26 +02:00
David Cramer 2361172e78 Abstract internal error check for logging handler 2013-08-27 00:02:01 -07:00
Xavier Ordoquy 2a1dd41785 Don't forget py3 compat. 2013-07-23 02:52:35 +02:00
Xavier Ordoquy 67547eb3e7 Handle the case where we have binary strings sent to logging. 2013-07-23 02:31:14 +02:00
David Cramer f4c2969e92 Some more sanity to prevent recursion 2013-05-27 18:55:12 +08:00
David Cramer ecd33018ef Exclude raven from SentryHandler 2013-05-06 00:35:29 -07:00
Xavier Ordoquy 0598aa3220 Removed unused to_unicode import. 2013-04-23 07:36:04 +02:00
David Cramer e93b64da92 minor style cleanup 2013-04-22 21:27:59 -07:00
Xavier Ordoquy 90b5846a06 Python3 port ! 2013-04-01 23:23:03 +02:00
David Cramer 7a917c1058 Proper repr of all variables 2013-03-31 02:12:50 -07:00
Xavier Ordoquy 525778d476 Use six and compat module to provide a python3 compatibility. 2013-03-29 00:14:19 +01:00
David Cramer db627763e6 Correct logbook formatting behavior (fixes GH-260) 2013-02-15 12:14:22 -08:00
David Cramer 76b2b935c8 Correctly handle tags when an event has exception data 2013-02-14 11:47:15 -08:00
David Cramer f3b0b21487 Improve how we label unknown functions and modules, and remove the function from the include path detection 2013-02-07 11:40:48 -08:00
David Cramer 0bea68328f Bad indentation 2013-01-15 17:42:22 -08:00
Tyler Jones dde32f5b73 Allow adding tags to events. 2013-01-15 13:05:22 -08:00
Richard Graham 7e2e765c50 If a SentryHandler's client is set with `raise_send_errors = True`, do not handle the errors in `SentryHandler.emit`. 2013-01-08 08:46:14 +02:00
David Cramer a570217dea Ensure logging records group based on exception logic 2013-01-03 16:50:28 -08:00
David Cramer 3a72752765 Change culprits to be 'module in function' (fixes GH-235) 2013-01-02 16:45:13 -08:00
David Cramer 3bc464183b Switch some calls off of capture and onto their correct counterparts 2012-12-26 13:28:58 -08:00
David Cramer dd0677b58e Clean up logging tests and behavior to be more precise 2012-12-07 21:36:26 -08:00
David Cramer b2a7247be1 Record culprits on log messages that have none 2012-10-19 16:01:13 -07:00
David Cramer 13260b0f5b its not 2010 anymore 2012-10-12 10:45:59 -07:00
David Cramer 3f900afd20 Handle data value not being a dict (e.g. non raven spec) (fixes GH-178) 2012-09-13 12:30:55 -07:00
David Cramer 21386e4766 Dont fail hard when logging handlers raise an exception (fixes GH-167) 2012-08-06 11:47:51 -07:00
David Cramer d5075b92f4 Merge pull request #142 from do3cc/master
Apparently I screwed up and my manifest.in changes were missing. The 2.0.0 egg is missing a component.xml
2012-07-13 19:36:06 -07:00
kiddouk 2b51d9f5df Allow SentryHandler to set its private Log Level 2012-07-13 17:33:58 +02:00
Patrick Gerken f19eeee462 It can happen that last_mod is None here 2012-07-05 19:04:36 +02:00
David Cramer da1013b971 Dont log "private" variables from logging records 2012-05-17 08:29:39 -07:00
David Cramer 88237631d3 Ensure the logging handler maintains backwards compatibility due to its use in things like django-perftools (fixes GH-85) 2012-04-19 13:15:41 -07:00
David Cramer 5bb33505d1 Correct how frames are passed around so they always include lineno 2012-04-13 16:42:30 -07:00
David Cramer f34925b385 Correct explicit stack iter behavior in logging 2012-02-28 03:19:46 -08:00
David Cramer 6693b90b8d Coerce stderr to strings as required by some channels (fixes GH-71) 2012-02-25 23:59:51 -08:00
Eli Ribble b947691372 Removed a couple more items from the logging record that don't make a lot of sense in sentry 2012-02-10 09:45:24 -07:00
Eli Ribble 0f5c7c4d74 Prior to this commit extra data that we wanted to pass in to sentry from the python loggin client would have to look like this:
logger.info("This is message %d of %d", 1, 1, extra={'data':{'my extra data':'This is whatever I want it to be'}})

This is because python's logging system will take whatever the contents of 'extra' are and attach each item to the record like this:
        if extra is not None:
            for key in extra:
                if (key in ["message", "asctime"]) or (key in rv.__dict__):
                    raise KeyError("Attempt to overwrite %r in LogRecord" % key)
                rv.__dict__[key] = extra[key]

Then raven, when it gets to handle the message, looks only for record.extra. Therefore in order to get the extra data in one needed
to use a dictionary in a dictionary.

This change makes raven use any extra data on the record so that the above message can become:
    logger.info("This is message %d of %d", 1, 1, extra={'my extra data':'This is whatever I want it to be'})

It also has the added benefit of including other data that is on the record object but not normally passed to sentry. This includes the following:

thread: -1216764224
threadName: MainThread
processName: MainProcess
filename: log_test.py
lineno: 44
created: 1328891489.6684151
levelname: 'ERROR'
2012-02-10 09:37:58 -07:00
David Cramer 2d06093e35 Allow checksums to be passed into the client and adjust logging behavior so it uses the stacktrace checksum, rather than the message value. 2012-02-06 16:08:46 -08:00
David Cramer 0f5956dc73 Support sending the culprit with logging messages as part of extra 2012-02-01 14:30:44 -08:00
David Cramer 919e6e6025 Bring logbook up to speed with logging 2012-01-30 01:13:10 -08:00
David Cramer 5a06e43657 Improve logging and logbook handlers to follow the rest of raven's standards 2012-01-30 00:53:31 -08:00
David Cramer e6b18e941e Ensure we only log the correct chunk of stacks with logging 2012-01-26 15:16:11 -08:00
David Cramer 256f278675 Remove attr magic as it causes too many issues 2012-01-25 21:24:45 -08:00
David Cramer 7162ccbf54 Bring logging in line with what was expected (and previously correct) 2012-01-24 13:51:35 -08:00
Matt Robenolt 7f84457934 SentryHandler needs to mixin object
This fixes an error in raven.contrib.django.handlers.SentryHandler when
calling super().

At this point, SentryHandler is an old style Python class, 'classobj'
instead of 'type'. super() only works on new style 'type's, so we need
to mixin object to make it work.
2012-01-15 13:37:32 -05:00
David Cramer 9048ba6dff Cleanup various event handlers.
- Refactor hash handling to work as expected.
- Data is now flat with everything else.
- Logging record handling is now more implicit and tied to the logging handler.
- Handle HTTP interface in Django.
2011-10-20 22:49:19 -07:00