Skip to content

Commit cbdc802

Browse files
committed
Truncate log messages from the end
Our default pattern layout truncates log messages. This is to avoid blowing disk space from excessively log messages, which can happen if a message contains a mapping or an large query. Yet, we trunacte from the beginning which is probably where the most germane information is. This commit modifies the default pattern layout to trunacte from the end. Relates #21609
1 parent 909f5b0 commit cbdc802

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

distribution/src/main/resources/config/log4j2.properties

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ appender.rolling.type = RollingFile
1313
appender.rolling.name = rolling
1414
appender.rolling.fileName = ${sys:es.logs}.log
1515
appender.rolling.layout.type = PatternLayout
16-
appender.rolling.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] %marker%.10000m%n
16+
appender.rolling.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] %marker%.-10000m%n
1717
appender.rolling.filePattern = ${sys:es.logs}-%d{yyyy-MM-dd}.log
1818
appender.rolling.policies.type = Policies
1919
appender.rolling.policies.time.type = TimeBasedTriggeringPolicy
@@ -28,7 +28,7 @@ appender.deprecation_rolling.type = RollingFile
2828
appender.deprecation_rolling.name = deprecation_rolling
2929
appender.deprecation_rolling.fileName = ${sys:es.logs}_deprecation.log
3030
appender.deprecation_rolling.layout.type = PatternLayout
31-
appender.deprecation_rolling.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] %marker%.10000m%n
31+
appender.deprecation_rolling.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] %marker%.-10000m%n
3232
appender.deprecation_rolling.filePattern = ${sys:es.logs}_deprecation-%i.log.gz
3333
appender.deprecation_rolling.policies.type = Policies
3434
appender.deprecation_rolling.policies.size.type = SizeBasedTriggeringPolicy
@@ -45,7 +45,7 @@ appender.index_search_slowlog_rolling.type = RollingFile
4545
appender.index_search_slowlog_rolling.name = index_search_slowlog_rolling
4646
appender.index_search_slowlog_rolling.fileName = ${sys:es.logs}_index_search_slowlog.log
4747
appender.index_search_slowlog_rolling.layout.type = PatternLayout
48-
appender.index_search_slowlog_rolling.layout.pattern = [%d{ISO8601}][%-5p][%-25c] %marker%.10000m%n
48+
appender.index_search_slowlog_rolling.layout.pattern = [%d{ISO8601}][%-5p][%-25c] %marker%.-10000m%n
4949
appender.index_search_slowlog_rolling.filePattern = ${sys:es.logs}_index_search_slowlog-%d{yyyy-MM-dd}.log
5050
appender.index_search_slowlog_rolling.policies.type = Policies
5151
appender.index_search_slowlog_rolling.policies.time.type = TimeBasedTriggeringPolicy
@@ -61,7 +61,7 @@ appender.index_indexing_slowlog_rolling.type = RollingFile
6161
appender.index_indexing_slowlog_rolling.name = index_indexing_slowlog_rolling
6262
appender.index_indexing_slowlog_rolling.fileName = ${sys:es.logs}_index_indexing_slowlog.log
6363
appender.index_indexing_slowlog_rolling.layout.type = PatternLayout
64-
appender.index_indexing_slowlog_rolling.layout.pattern = [%d{ISO8601}][%-5p][%-25c] %marker%.10000m%n
64+
appender.index_indexing_slowlog_rolling.layout.pattern = [%d{ISO8601}][%-5p][%-25c] %marker%.-10000m%n
6565
appender.index_indexing_slowlog_rolling.filePattern = ${sys:es.logs}_index_indexing_slowlog-%d{yyyy-MM-dd}.log
6666
appender.index_indexing_slowlog_rolling.policies.type = Policies
6767
appender.index_indexing_slowlog_rolling.policies.time.type = TimeBasedTriggeringPolicy

0 commit comments

Comments
 (0)