Skip to content

Commit

Permalink
Merge pull request #6941 from pascalgrimaud/logback-improvements
Browse files Browse the repository at this point in the history
Improve logback configuration in generated apps
  • Loading branch information
pascalgrimaud authored Jul 21, 2023
2 parents a69a40a + 3a26b4a commit c65822b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<!DOCTYPE configuration>
<configuration scan="true">
<include resource="org/springframework/boot/logging/logback/base.xml" />
<include resource="org/springframework/boot/logging/logback/console-appender.xml" />

<!-- The FILE and ASYNC appenders are here as examples for a production configuration -->
<!--
Expand Down Expand Up @@ -34,7 +35,7 @@
<!-- jhipster-needle-logback-add-log -->

<!-- https://logback.qos.ch/manual/configuration.html#shutdownHook and https://jira.qos.ch/browse/LOGBACK-1090 -->
<shutdownHook class="ch.qos.logback.core.hook.DelayingShutdownHook" />
<shutdownHook class="ch.qos.logback.core.hook.DefaultShutdownHook" />

<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
<resetJUL>true</resetJUL>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,10 @@
<configuration scan="true">
<include resource="org/springframework/boot/logging/logback/base.xml" />

<!-- The FILE and ASYNC appenders are here as examples for a production configuration -->
<!--
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>logFile.%d{yyyy-MM-dd}.log</fileNamePattern>
<maxHistory>90</maxHistory>
</rollingPolicy>
<encoder>
<charset>utf-8</charset>
<Pattern>%d %-5level [%thread] %logger{0}: %msg%n</Pattern>
</encoder>
</appender>
<appender name="ASYNC" class="ch.qos.logback.classic.AsyncAppender">
<queueSize>512</queueSize>
<appender-ref ref="FILE"/>
</appender>
<root level="${logging.level.root}">
<appender-ref ref="ASYNC"/>
</root>
-->

<logger name="{{packageName}}" level="OFF" />

<logger name="ch.qos.logback" level="WARN" />
<logger name="com.sun" level="WARN" />
<logger name="org.springframework" level="WARN" />
<!-- jhipster-needle-logback-add-log -->

<root>
<level value="WARN" />
<appender-ref ref="CONSOLE" />
</root>
</configuration>
1 change: 1 addition & 0 deletions src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<!DOCTYPE configuration>
<configuration scan="true">
<include resource="org/springframework/boot/logging/logback/base.xml" />
<include resource="org/springframework/boot/logging/logback/console-appender.xml" />

<!-- The FILE and ASYNC appenders are here as examples for a production configuration -->
<!--
Expand Down

0 comments on commit c65822b

Please sign in to comment.