- 최신
- 최다 투표
- 가장 많은 댓글
Hello,
I recommend you to use below json to update in EMR configurations to enable time based rotation along with size. Using below configurations, the rotation will get triggered either based on the time or size whichever meet the criteria. This helps in avoiding high disk utilization by rotating based on size .Also, help rotating the file if the size criteria doesn't meet for long duration. You may further tune below parameters based on your requirements.
[ { "Classification": "flink-log4j", "Properties": { "appender.main.append": "true", "appender.main.fileName": "${sys:log.file}", "appender.main.filePattern": "${sys:log.file}-%d{MM-dd-yy-HH-mm}-%i.gz", "appender.main.layout.pattern": "%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p %-60c %x - %m%n", "appender.main.layout.type": "PatternLayout", "appender.main.name": "MainAppender", "appender.main.policies.size.size": "100MB", "appender.main.policies.size.type": "SizeBasedTriggeringPolicy", "appender.main.policies.time.interval": "2", "appender.main.policies.time.modulate": "true", "appender.main.policies.time.type": "TimeBasedTriggeringPolicy", "appender.main.policies.type": "Policies", "appender.main.strategy.max": "${env:MAX_LOG_FILE_NUMBER:-10}", "appender.main.strategy.type": "DefaultRolloverStrategy", "appender.main.type": "RollingFile" } } ]
For more information on log4j configurations, I request you to refer doc[1] and to learn more about appenders you may refer doc[2]
[1] https://logging.apache.org/log4j/log4j-2.4/manual/configuration.html#Properties
[2] https://logging.apache.org/log4j/log4j-2.4/manual/appenders.html#RollingFileAppender
관련 콘텐츠
- AWS 공식업데이트됨 3년 전
- AWS 공식업데이트됨 일 년 전
- AWS 공식업데이트됨 일 년 전