1. Log4j2
bash
<AsyncRoot level="INFO">
<appender-ref ref="FILEERROR"/>
<appender-ref ref="FILEWARN"/>
<appender-ref ref="FILEINFO"/>
<appender-ref ref="FILEDEBUG"/>
<appender-ref ref="CONSOLE"/>
<appender-ref ref="GELF" if="${sys:spring.profiles.active:-dev} != 'dev'"/>
</AsyncRoot>
2. Logback
bash
<if condition='property("spring.profiles.active").equals("dev")'>
<then>
<root level="INFO">
<appender-ref ref="FILEERROR"/>
<appender-ref ref="FILEWARN"/>
<appender-ref ref="FILEINFO"/>
<appender-ref ref="FILEDEBUG"/>
<appender-ref ref="CONSOLE"/>
</root>
</then>
<else>
<root level="INFO">
<appender-ref ref="FILEERROR"/>
<appender-ref ref="FILEWARN"/>
<appender-ref ref="FILEINFO"/>
<appender-ref ref="FILEDEBUG"/>
<appender-ref ref="CONSOLE"/>
<appender-ref ref="GELF"/>
</root>
</else>
</if>