# Application performance lower after fixing agent logger level from warning to info

**URL:** <https://discuss.elastic.co/t/application-performance-lower-after-fixing-agent-logger-level-from-warning-to-info/224215>\
**Category:** APM\
**Tags:** python\
**Created:** [March 19, 2020, 5:34am UTC](https://discuss.elastic.co/t/application-performance-lower-after-fixing-agent-logger-level-from-warning-to-info/224215 "2020-03-19T05:34:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jinner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jinner/32/48265_2.png) [@jinner](https://discuss.elastic.co/u/jinner)\
**Post date:** [March 19, 2020, 5:34am UTC](https://discuss.elastic.co/t/application-performance-lower-after-fixing-agent-logger-level-from-warning-to-info/224215/1 "2020-03-19T05:34:00Z")

</div>

Hey, I'm currently doing instrumentation of service and detects some errors rn..  
my elastic versions are like below and the problem is when agent comes to the version of 5.3.3 and turn log level from warning to info. The application used to take 2 secs but after changing agent log level to info(elasticapm), it takes more than 6 secs which is too long to open the service.  
i assume that since all info level logs are sent to server, the performance might be lower but how can i make it faster??

**Kibana version** :  
7.6.1  
**Elasticsearch version** :  
7.6.1  
**APM Server version** :  
7.6.1  
**APM Agent language and version** :  
python(django), 5.3.3  
**Browser version** :

--- DJANGO BASE.PY ---

```auto

MIDDLEWARE = [
    'django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
    'elasticapm.contrib.django.middleware.TracingMiddleware',
    'elasticapm.contrib.django.middleware.Catch404Middleware',
    'corsheaders.middleware.CorsMiddleware',
]

LOGGING = {'version': 1,
           'disable_existing_loggers': False,
           'formatters': {
               'verbose': {
                   'format' : "[%(asctime)s] %(levelname)s [%(name)s:%(lineno)s] %(message)s",
                   'datefmt' : "%d/%b/%Y %H:%M:%S"
               },
               'simple': {
                   'format': '%(levelname)s %(message)s'
               },
           },
           'handlers': {'file': {'level': 'DEBUG',
                                 'class': 'logging.handlers.TimedRotatingFileHandler',
                                 'when' : 'H',
                                 'backupCount': 100,
                                 'filename': LOG_FILE_NAME,
                                 'formatter': 'verbose',
                                 },
                        'console': {
                                    'level': 'DEBUG',
                                    'class': 'logging.StreamHandler',
                                    'formatter': 'verbose',
                                   },
                        'elasticapm': {
                                      'level': 'INFO', (#### <- HERE )
                                      'class': 'elasticapm.contrib.django.handlers.LoggingHandler',
                                  },
                      },
           'loggers': {
                       'apm.errors': {
                           'level': 'ERROR',
                           'handlers': ['console', 'file'],
                           'propagate': False,
                       },
                       'django.db.backends': {
                           'level': 'ERROR',
                           'handlers': ['file'], # 'console',
                           'propagate': False,
                       },
                       'django': {'handlers': ['console', 'elasticapm','file'], #'console',
                                  'level': 'INFO',
                                  'propagate': True,
                                  },
                       'celery': {'handlers': ['console','elasticapm','file'], #'console',
                                  'level': 'INFO',
                                  'propagate': True,
                                  },
                       'ssg_imgr_app': {
                                    'handlers': ['console', 'elasticapm', 'file'],
                                    'level': 'INFO',
                                    'propagate': True,
                                    },
                       'ssg-ocr-app': {
                           'level': 'INFO',
                           'handlers': ['console', 'elasticapm', 'file'], #'console',
                           'propagate': True,
                       },
           },
}

```

---

<div class="post-metadata">

**Author:** ![basepi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/basepi/32/53056_2.png) [@basepi](https://discuss.elastic.co/u/basepi)\
**Post date:** [March 20, 2020, 2:24am UTC](https://discuss.elastic.co/t/application-performance-lower-after-fixing-agent-logger-level-from-warning-to-info/224215/2 "2020-03-20T02:24:29Z")

</div>

Welcome to the community, @jinner! Thanks for the question.

Unfortunately, the python agent isn't tuned for sending of mass amounts of logs to Elasticsearch. We provide the [elasticapm LoggingHandler](https://www.elastic.co/guide/en/beats/filebeat/7.6) for the convenience of easily being able to send error logs out of the box, but if you'd like to ingest more logs from your app we recommend using [filebeat](https://www.elastic.co/guide/en/beats/filebeat/7.6). It is much more efficient and won't impact your app's performance in the same way that shipping those logs with the agent will.

---

<div class="post-metadata">

**Author:** ![jinner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jinner/32/48265_2.png) [@jinner](https://discuss.elastic.co/u/jinner)\
**Post date:** [March 23, 2020, 11:38pm UTC](https://discuss.elastic.co/t/application-performance-lower-after-fixing-agent-logger-level-from-warning-to-info/224215/3 "2020-03-23T23:38:16Z")

</div>

Thanks! maybe i should think about using filebeat..! btw, is there any recommended size of logs(just for information)

---

<div class="post-metadata">

**Author:** ![basepi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/basepi/32/53056_2.png) [@basepi](https://discuss.elastic.co/u/basepi)\
**Post date:** [March 24, 2020, 8:06pm UTC](https://discuss.elastic.co/t/application-performance-lower-after-fixing-agent-logger-level-from-warning-to-info/224215/4 "2020-03-24T20:06:38Z")

</div>

I'm not sure I understand. What do you mean by "size of logs"?

---

<div class="post-metadata">

**Author:** ![jinner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jinner/32/48265_2.png) [@jinner](https://discuss.elastic.co/u/jinner)\
**Post date:** [March 25, 2020, 12:02am UTC](https://discuss.elastic.co/t/application-performance-lower-after-fixing-agent-logger-level-from-warning-to-info/224215/5 "2020-03-25T00:02:51Z")

</div>

Oops, i understood elasticapm LoggingHandler is not able to ingest much amount of logs or effects application performance according to your mention above.  
[Unfortunately, the python agent isn't tuned for sending of mass amounts of logs to Elasticsearch. We provide the elasticapm LoggingHandler for the convenience of easily being able to send error logs out of the box, but if you'd like to ingest more logs from your app we recommend using filebeat]  
so what i meant "size of logs" is, maximum size of logs that agent easily handle. But seems like only error or transaction logs are recommended to ingest..! Thank you very much

---

<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:** [April 14, 2020, 8:03pm UTC](https://discuss.elastic.co/t/application-performance-lower-after-fixing-agent-logger-level-from-warning-to-info/224215/6 "2020-04-14T20:03:01Z")

</div>

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