So if there are 2 handlers to a logger say
ch = logging.StreamHandler(sys.stdout)
ch.setLevel(logging.DEBUG)
ch.setFormatter(logging.Formatter('%(message)s')) # Logs are pre-formatted as JSON strings
# File handler for custom human-readable output
fh = logging.FileHandler(os.environ["LOG_FILE_LOCATION"])
fh.setLevel(logging.DEBUG)
fh.setFormatter(CustomFileFormatter())
logger.addHandler(ch)
logger.addHandler(fh)
which handler will be used by sentry to display an error message ?
Also, if i want to custom format the output thats sent to sentry what should i do ?
If a sample message in sentry is like this,
{"event": "Error event", "logger": "A.a1", "level": "error", "environment": "staging", "image_name": "X", "target_module": "Y", "filename": "/usr/local/lib/python3.10/site-packages/structlog/stdlib.py", "lineno": 247, "function": "_proxy_to_logger", "timestamp": "2024-07-22T06:58:00.499028Z"}
what can I do to have a sentry record with message = event and all other key/value pairs as tags and values to them