Skip to content

Commit

Permalink
Allow the console log level to be configured based on the currently a…
Browse files Browse the repository at this point in the history
…ctive Maven profile
  • Loading branch information
vladmihalcea committed Mar 7, 2020
1 parent 079cd38 commit 5a4d487
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
4 changes: 2 additions & 2 deletions hibernate-types-4/src/test/resources/logback-test.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<configuration>
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>WARN</level>
<level>${console.log.level}</level>
</filter>
<encoder>
<Pattern>%-5p [%t]: %c{1} - %m%n</Pattern>
<charset>UTF-8</charset>
</encoder>
</appender>

<logger name="com.vladmihalcea" level="debug"/>
<logger name="Hibernate Types" level="debug"/>
<logger name="org.hibernate.engine.jdbc.spi.SqlExceptionHelper" level="error"/>

<!--<logger name="org.hibernate.SQL" level="trace"/>
Expand Down
4 changes: 2 additions & 2 deletions hibernate-types-43/src/test/resources/logback-test.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<configuration>
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>WARN</level>
<level>${console.log.level}</level>
</filter>
<encoder>
<Pattern>%-5p [%t]: %c{1} - %m%n</Pattern>
<charset>UTF-8</charset>
</encoder>
</appender>

<logger name="com.vladmihalcea" level="debug"/>
<logger name="Hibernate Types" level="debug"/>
<logger name="org.hibernate.engine.jdbc.spi.SqlExceptionHelper" level="error"/>

<!--<logger name="org.hibernate.SQL" level="trace"/>
Expand Down
4 changes: 2 additions & 2 deletions hibernate-types-5/src/test/resources/logback-test.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<configuration>
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>WARN</level>
<level>${console.log.level}</level>
</filter>
<encoder>
<Pattern>%-5p [%t]: %c{1} - %m%n</Pattern>
<charset>UTF-8</charset>
</encoder>
</appender>

<logger name="com.vladmihalcea" level="debug"/>
<logger name="Hibernate Types" level="debug"/>
<logger name="org.hibernate.engine.jdbc.spi.SqlExceptionHelper" level="error"/>

<!--<logger name="org.hibernate.SQL" level="trace"/>
Expand Down
4 changes: 2 additions & 2 deletions hibernate-types-52/src/test/resources/logback-test.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<configuration>
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>WARN</level>
<level>${console.log.level}</level>
</filter>
<encoder>
<Pattern>%-5p [%t]: %c{1} - %m%n</Pattern>
<charset>UTF-8</charset>
</encoder>
</appender>

<logger name="com.vladmihalcea" level="debug"/>
<logger name="Hibernate Types" level="debug"/>
<logger name="org.hibernate.engine.jdbc.spi.SqlExceptionHelper" level="error"/>

<!--<logger name="org.hibernate.SQL" level="trace"/>
Expand Down
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@
<value>true</value>
</property>
</activation>
<properties>
<console.log.level>ERROR</console.log.level>
</properties>
<build>
<plugins>
<plugin>
Expand Down Expand Up @@ -280,6 +283,8 @@
<jdk.version>6</jdk.version>
<jdk8>${env.JAVA_HOME_8}</jdk8>

<console.log.level>DEBUG</console.log.level>

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<maven-toolchains-plugin.version>3.0.0</maven-toolchains-plugin.version>
Expand Down

0 comments on commit 5a4d487

Please sign in to comment.