- Più recenti
- Maggior numero di voti
- Maggior numero di commenti
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
Contenuto pertinente
- AWS UFFICIALEAggiornata 2 anni fa
- AWS UFFICIALEAggiornata 5 mesi fa
- AWS UFFICIALEAggiornata 2 anni fa