client = Client('http://5fd12f6d0f5349e3ac76a6d2e971a3e6:e14ddd7492414ea2...@192.168.0.8/5')
log_formatter = logging.Formatter('%(levelname)s,%(asctime)s,%(message)s', datefmt='%d/%m/%Y %H:%M:%S')
logger = logging.getLogger(__name__)
logger.setLevel(logging.ERROR)
sentry_handler = SentryHandler(client)
sentry_handler.setLevel(logging.ERROR)
sentry_handler.setFormatter(log_formatter)
logger.addHandler(sentry_handler)
and i want to make some custom tags like this:
try:
# ...
except Exception:
logger.error(exc_info=True) # how to set custom tags here ?
--
You received this message because you are subscribed to the Google Groups "sentry" group.
To unsubscribe from this group and stop receiving emails from it, send an email to getsentry+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
i tried this : logger.error('UnKnown Exception', exc_info=True, extra={'client': user})
but on sentry it appears under 'Additional Data' and not in Tags
i need it to be in Tags so i can filter errors based on some custom tags.
any idea how to achieve this ?
thanks in advance
You send all metadata to log handlers via the 'extra' argument.
Hi everyone,
i am a litte confused about how to set custom tags at event level
this is my logger config:
log_formatter = logging.Formatter('%(levelname)s,%(asctime)s,%(message)s', datefmt='%d/%m/%Y %H:%M:%S')
logger = logging.getLogger(__name__)
logger.setLevel(logging.ERROR)
sentry_handler = SentryHandler(client)
sentry_handler.setLevel(logging.ERROR)
sentry_handler.setFormatter(log_formatter)
logger.addHandler(sentry_handler)
and i want to make some custom tags like this:
try:
# ...
except Exception:
logger.error(exc_info=True) # how to set custom tags here ?
logger.error('UnKnown Exception', exc_info=True, tags={'client': user})
but i get TypeError: _log() got an unexpected keyword argument 'tags'
i searched in the docs and google for this but i didn't find anything usefull for me; if so i wouldn't be asking for help here.
i triedi already read the docs,there isn't much about Tags in the doc but a small example in JavaScript.
logger.error('UnKnown Exception', exc_info=True, tags={'client': user})but i get TypeError: _log() got an unexpected keyword argument 'tags'i searched in the docs and google for this but i didn't find anything usefull for me; if so i wouldn't be asking for help here.
On Wednesday, August 3, 2016 at 5:50:53 PM UTC+1, David Cramer wrote:
Please take a look at our docs. Extra is not the mapping of tags, it's simply a mapping of additional data. Tags are their own argument without extra.
i tried this : logger.error('UnKnown Exception', exc_info=True, extra={'client': user})
but on sentry it appears under 'Additional Data' and not in Tags
i need it to be in Tags so i can filter errors based on some custom tags.
any idea how to achieve this ?
thanks in advance
On Wednesday, August 3, 2016 at 5:36:27 PM UTC+1, David Cramer wrote:
You send all metadata to log handlers via the 'extra' argument.
Hi everyone,
i am a litte confused about how to set custom tags at event level
this is my logger config:
client = Client('http://5fd12f6d0f5349e3ac76a6d2e971a3e6:e14ddd7492414ea2...@192.168.0.8/5')
log_formatter = logging.Formatter('%(levelname)s,%(asctime)s,%(message)s', datefmt='%d/%m/%Y %H:%M:%S')
logger = logging.getLogger(__name__)
logger.setLevel(logging.ERROR)
sentry_handler = SentryHandler(client)
sentry_handler.setLevel(logging.ERROR)
sentry_handler.setFormatter(log_formatter)
logger.addHandler(sentry_handler)
and i want to make some custom tags like this:
try:
# ...
except Exception:
logger.error(exc_info=True) # how to set custom tags here ?
--
You received this message because you are subscribed to the Google Groups "sentry" group.
To unsubscribe from this group and stop receiving emails from it, send an email to getsentry+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "sentry" group.
To unsubscribe from this group and stop receiving emails from it, send an email to getsentry+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi everyone,
i am a litte confused about how to set custom tags at event level
this is my logger config: