# Deprecation logs not being logged to file in Elasticsearch 7.15

**URL:** <https://discuss.elastic.co/t/deprecation-logs-not-being-logged-to-file-in-elasticsearch-7-15/294016>\
**Category:** Elasticsearch\
**Created:** [January 11, 2022, 10:18am UTC](https://discuss.elastic.co/t/deprecation-logs-not-being-logged-to-file-in-elasticsearch-7-15/294016 "2022-01-11T10:18:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Suraj\_Kumar4](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/suraj_kumar4/32/100132_2.png) [@Suraj\_Kumar4](https://discuss.elastic.co/u/Suraj_Kumar4)\
**Post date:** [January 11, 2022, 10:18am UTC](https://discuss.elastic.co/t/deprecation-logs-not-being-logged-to-file-in-elasticsearch-7-15/294016/1 "2022-01-11T10:18:24Z")

</div>

Snippet of the log4j2.properties file being used with ES 7.15.2

```auto
status = error

appender.console.type = Console
appender.console.name = console
appender.console.layout.type = PatternLayout
appender.console.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] [%node_name]%marker %m%n

######## Server JSON ############################
appender.rolling.type = RollingFile
appender.rolling.name = rolling
appender.rolling.layout.type = ESJsonLayout
appender.rolling.layout.type_name = server

appender.rolling.filePattern = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}_server-%d{yyyy-MM-dd}.json
appender.rolling.policies.type = Policies
appender.rolling.policies.time.type = TimeBasedTriggeringPolicy
appender.rolling.policies.time.interval = 1
appender.rolling.policies.time.modulate = true

######Deletion of log files based on createdDate > 3 days DirectWriteRolloverStrategy
appender.rolling.strategy.type = DirectWriteRolloverStrategy
appender.rolling.strategy.action.type = Delete
appender.rolling.strategy.action.basepath = ${sys:es.logs.base_path}
appender.rolling.strategy.action.condition.type = IfFileName
appender.rolling.strategy.action.condition.glob = ${sys:es.logs.cluster_name}_server-*
appender.rolling.strategy.action.condition.nested_condition.type = IfAccumulatedFileCount
appender.rolling.strategy.action.condition.nested_condition.exceeds = 3
##########
rootLogger.level = info
rootLogger.appenderRef.console.ref = console
rootLogger.appenderRef.rolling.ref = rolling
######## Deprecation JSON #######################
appender.deprecation_rolling.type = RollingFile
appender.deprecation_rolling.name = deprecation_rolling
appender.deprecation_rolling.layout.type = ESJsonLayout
appender.deprecation_rolling.layout.type_name = deprecation
appender.deprecation_rolling.layout.esmessagefields=x-opaque-id

appender.deprecation_rolling.filePattern = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}_deprecation-%d{yyyy-MM-dd}.json
appender.deprecation_rolling.policies.type = Policies
appender.deprecation_rolling.policies.time.type = TimeBasedTriggeringPolicy
appender.deprecation_rolling.policies.time.interval = 1
appender.deprecation_rolling.policies.time.modulate = true

appender.deprecation_rolling.strategy.type = DirectWriteRolloverStrategy
appender.deprecation_rolling.strategy.action.type = Delete
appender.deprecation_rolling.strategy.action.basepath = ${sys:es.logs.base_path}
appender.deprecation_rolling.strategy.action.condition.type = IfFileName
appender.deprecation_rolling.strategy.action.condition.glob = ${sys:es.logs.cluster_name}_deprecation-*
appender.deprecation_rolling.strategy.action.condition.nested_condition.type = IfAccumulatedFileCount
appender.deprecation_rolling.strategy.action.condition.nested_condition.exceeds = 3

#################################################

logger.deprecation.name = org.elasticsearch.deprecation
logger.deprecation.level = warn
logger.deprecation.appenderRef.deprecation_rolling.ref = deprecation_rolling
logger.deprecation.additivity = false

```

The same property file when used with ES 7.9 writes deprecation logs when some deprecated feature is being used.

To generate a deprecation log I am creating an index with `include_type_name`

```auto
curl -v -XPUT "localhost:9205/test?include_type_name=true&pretty" -H 'Content-Type: application/json' -d'
{
    "settings": {
        "number_of_shards": 1
    },
    "mappings": {
    "testtype":{
        "properties": {
            "field1": {
                "type": "text"
            }
        }
        }
    }
}
'

```

As mentioned previously the logFile gets created when the above request is hit in ES 7.9  
But with ES 7.15.2, the deprecation logFile is not getting created.

Note: We were using a single node cluster with ES 7.9 and upgraded it to ES 7.15.2 (Rolling Upgrade) and noticed that deprecations logs are not being generated even on using a deprecated feature.

---

<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:** [February 8, 2022, 10:18am UTC](https://discuss.elastic.co/t/deprecation-logs-not-being-logged-to-file-in-elasticsearch-7-15/294016/2 "2022-02-08T10:18:59Z")

</div>

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