# \[python\] Proper way to change APM logging level

**URL:** <https://discuss.elastic.co/t/python-proper-way-to-change-apm-logging-level/176265>\
**Category:** APM\
**Created:** [April 10, 2019, 4:14pm UTC](https://discuss.elastic.co/t/python-proper-way-to-change-apm-logging-level/176265 "2019-04-10T16:14:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jkaoiadjmdna](https://avatars.discourse-cdn.com/v4/letter/j/858c86/32.png) [@jkaoiadjmdna](https://discuss.elastic.co/u/jkaoiadjmdna)\
**Post date:** [April 10, 2019, 4:14pm UTC](https://discuss.elastic.co/t/python-proper-way-to-change-apm-logging-level/176265/1 "2019-04-10T16:14:06Z")

</div>

When setting up a python logger, what is the proper way to change the APM logging level to something other than the default? We don't want the metrics submission messages logged in prod:

`Sent request, url=http://apm-server.default.svc.cluster.local:8200/v1/transactions size=0.56kb status=202`

We currently have a logger config like this (using structlog but I think that's not consequential here), so can we just add the change in `loggers`?

```
logging.config.dictConfig({
    'version': 1,
    'disable_existing_loggers': False,
    'formatters': {
        'json': {
            'format': '%(message)s %(lineno)d %(pathname)s',
            'class': 'pythonjsonlogger.jsonlogger.JsonFormatter'
        }
    },
    'handlers': {
        'json': {
            'class': 'logging.StreamHandler',
            'formatter': 'json'
        }
    },
    'loggers': {
        '': {
            'handlers': ['json'],
            'level': LOG_LEVEL
        },
        'elasticapm': {
            'level': 'logging.WARNING',
            'propagate': False,
        },
    }
})
```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 1, 2019, 12:14pm UTC](https://discuss.elastic.co/t/python-proper-way-to-change-apm-logging-level/176265/2 "2019-05-01T12:14:11Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
