I'm using APM on a flask application with logbook.
Here is how I register LogBook handlers:
from elasticapm.handlers.logbook import LogbookHandler as ElasticHandler
...
if not offline:
# Sentry
sentry.init_app(app=app)
sentry_handler = SentryHandler(sentry.client, level='WARNING')
logger.handlers.append(sentry_handler)
# Elastic APM
apm = ElasticAPM(app)
elastic_handler = ElasticHandler(client=apm.client, bubble=True)
logger.handlers.append(elastic_handler)
Here is how I use logger:
logger.info('App created with `{0}` config'.format(app.config['CONFIG_NAME']), stack=False)
Since I already have Sentry, I just want to use Elastic APM to centralize my logs. But on the APM panel in Kibana, all the logs as treated as errors. Is there any way to adjust this behavior? Thanks!