Browse Source

Switch to Log4j2

pull/376/head
Decebal Suiu 5 years ago
parent
commit
fd72b53892
  1. 20
      demo/app/pom.xml
  2. 20
      demo/app/src/main/resources/log4j.properties
  3. 27
      demo/app/src/main/resources/log4j2.properties
  4. 20
      maven-archetypes/quickstart/src/main/resources/archetype-resources/app/pom.xml
  5. 20
      maven-archetypes/quickstart/src/main/resources/archetype-resources/app/src/main/resources/log4j.properties
  6. 27
      maven-archetypes/quickstart/src/main/resources/archetype-resources/app/src/main/resources/log4j2.properties
  7. 1
      maven-archetypes/quickstart/src/main/resources/archetype-resources/pom.xml
  8. 26
      pf4j/pom.xml
  9. 20
      pf4j/src/test/resources/log4j.properties
  10. 27
      pf4j/src/test/resources/log4j2.properties
  11. 1
      pom.xml

20
demo/app/pom.xml

@ -75,17 +75,21 @@
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
<!-- Logs --> <!-- Logging -->
<dependency> <dependency>
<groupId>log4j</groupId> <groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId> <artifactId>log4j-api</artifactId>
<version>1.2.16</version> <version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.slf4j</groupId> <groupId>org.apache.logging.log4j</groupId>
<artifactId>slf4j-log4j12</artifactId> <artifactId>log4j-slf4j-impl</artifactId>
<version>${slf4j.version}</version> <version>${log4j.version}</version>
</dependency> </dependency>
<dependency> <dependency>

20
demo/app/src/main/resources/log4j.properties

@ -1,20 +0,0 @@
log4j.rootLogger=DEBUG, Console
#
# PF4J log
#
log4j.logger.org.pf4j=DEBUG, Console
# !!! Put the bellow classes on level TRACE when you are in trouble
log4j.logger.org.pf4j.PluginClassLoader=DEBUG, Console
log4j.logger.org.pf4j.AbstractExtensionFinder=DEBUG, Console
log4j.additivity.org.pf4j=false
log4j.additivity.org.pf4j.PluginClassLoader=false
log4j.additivity.org.pf4j.AbstractExtensionFinder=false
#
# Appenders
#
log4j.appender.Console=org.apache.log4j.ConsoleAppender
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
#log4j.appender.Console.layout.conversionPattern=%-5p - %-32.32c{1} - %m\n
log4j.appender.Console.layout.ConversionPattern=%d %p %c - %m%n

27
demo/app/src/main/resources/log4j2.properties

@ -0,0 +1,27 @@
#
# Appenders
#
appender.console.type = Console
appender.console.name = console
appender.console.layout.type = PatternLayout
#appender.console.layout.pattern = %-5p - %-32.32c{1} - %m\n
appender.console.layout.pattern = %d %p %c - %m%n
#
# Loggers
#
# PF4J log
logger.pf4j.name = org.pf4j
logger.pf4j.level = debug
logger.pf4j.additivity = false
logger.pf4j.appenderRef.console.ref = console
# !!! Uncomment below loggers when you are in trouble
#logger.loader.name = org.pf4j.PluginClassLoader
#logger.loader.level = trace
#logger.finder.name = org.pf4j.AbstractExtensionFinder
#logger.finder.level = trace
rootLogger.level = debug
rootLogger.appenderRef.console.ref = console

20
maven-archetypes/quickstart/src/main/resources/archetype-resources/app/pom.xml

@ -63,17 +63,21 @@
<version>${pf4j.version}</version> <version>${pf4j.version}</version>
</dependency> </dependency>
<!-- Logs --> <!-- Logging -->
<dependency> <dependency>
<groupId>log4j</groupId> <groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId> <artifactId>log4j-api</artifactId>
<version>1.2.16</version> <version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.slf4j</groupId> <groupId>org.apache.logging.log4j</groupId>
<artifactId>slf4j-log4j12</artifactId> <artifactId>log4j-slf4j-impl</artifactId>
<version>${slf4j.version}</version> <version>${log4j.version}</version>
</dependency> </dependency>
<dependency> <dependency>

20
maven-archetypes/quickstart/src/main/resources/archetype-resources/app/src/main/resources/log4j.properties

@ -1,20 +0,0 @@
log4j.rootLogger=DEBUG, Console
#
# PF4J log
#
log4j.logger.org.pf4j=DEBUG, Console
# !!! Put the bellow classes on level TRACE when you are in trouble
log4j.logger.org.pf4j.PluginClassLoader=DEBUG, Console
log4j.logger.org.pf4j.AbstractExtensionFinder=DEBUG, Console
log4j.additivity.org.pf4j=false
log4j.additivity.org.pf4j.PluginClassLoader=false
log4j.additivity.org.pf4j.AbstractExtensionFinder=false
#
# Appenders
#
log4j.appender.Console=org.apache.log4j.ConsoleAppender
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
#log4j.appender.Console.layout.conversionPattern=%-5p - %-32.32c{1} - %m\n
log4j.appender.Console.layout.ConversionPattern=%d %p %c - %m%n

27
maven-archetypes/quickstart/src/main/resources/archetype-resources/app/src/main/resources/log4j2.properties

@ -0,0 +1,27 @@
#
# Appenders
#
appender.console.type = Console
appender.console.name = console
appender.console.layout.type = PatternLayout
#appender.console.layout.pattern = %-5p - %-32.32c{1} - %m\n
appender.console.layout.pattern = %d %p %c - %m%n
#
# Loggers
#
# PF4J log
logger.pf4j.name = org.pf4j
logger.pf4j.level = debug
logger.pf4j.additivity = false
logger.pf4j.appenderRef.console.ref = console
# !!! Uncomment below loggers when you are in trouble
#logger.loader.name = org.pf4j.PluginClassLoader
#logger.loader.level = trace
#logger.finder.name = org.pf4j.AbstractExtensionFinder
#logger.finder.level = trace
rootLogger.level = debug
rootLogger.appenderRef.console.ref = console

1
maven-archetypes/quickstart/src/main/resources/archetype-resources/pom.xml

@ -27,6 +27,7 @@
<pf4j.version>{{project.version}}</pf4j.version> <pf4j.version>{{project.version}}</pf4j.version>
<slf4j.version>1.7.7</slf4j.version> <slf4j.version>1.7.7</slf4j.version>
<log4j.version>2.13.1</log4j.version>
</properties> </properties>
<build> <build>

26
pf4j/pom.xml

@ -72,12 +72,6 @@
<artifactId>slf4j-api</artifactId> <artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version> <version>${slf4j.version}</version>
</dependency> </dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
<scope>test</scope>
</dependency>
<dependency> <dependency>
<groupId>com.github.zafarkhaja</groupId> <groupId>com.github.zafarkhaja</groupId>
<artifactId>java-semver</artifactId> <artifactId>java-semver</artifactId>
@ -90,6 +84,26 @@
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>
<!-- Logging -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>${log4j.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>${log4j.version}</version>
<scope>test</scope>
</dependency>
<!-- Testing --> <!-- Testing -->
<dependency> <dependency>
<groupId>org.hamcrest</groupId> <groupId>org.hamcrest</groupId>

20
pf4j/src/test/resources/log4j.properties

@ -1,20 +0,0 @@
log4j.rootLogger=DEBUG, Console
#
# PF4J log
#
log4j.logger.org.pf4j=DEBUG, Console
# !!! Put the bellow classes on level TRACE when you are in trouble
log4j.logger.org.pf4j.PluginClassLoader=WARN, Console
log4j.logger.org.pf4j.AbstractExtensionFinder=DEBUG, Console
log4j.additivity.org.pf4j=false
log4j.additivity.org.pf4j.PluginClassLoader=false
log4j.additivity.org.pf4j.AbstractExtensionFinder=false
#
# Appenders
#
log4j.appender.Console=org.apache.log4j.ConsoleAppender
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
#log4j.appender.Console.layout.conversionPattern=%-5p - %-32.32c{1} - %m\n
log4j.appender.Console.layout.ConversionPattern=%d %p %c - %m%n

27
pf4j/src/test/resources/log4j2.properties

@ -0,0 +1,27 @@
#
# Appenders
#
appender.console.type = Console
appender.console.name = console
appender.console.layout.type = PatternLayout
#appender.console.layout.pattern = %-5p - %-32.32c{1} - %m\n
appender.console.layout.pattern = %d %p %c - %m%n
#
# Loggers
#
# PF4J log
logger.pf4j.name = org.pf4j
logger.pf4j.level = debug
logger.pf4j.additivity = false
logger.pf4j.appenderRef.console.ref = console
# !!! Uncomment below loggers when you are in trouble
#logger.loader.name = org.pf4j.PluginClassLoader
#logger.loader.level = trace
#logger.finder.name = org.pf4j.AbstractExtensionFinder
#logger.finder.level = trace
rootLogger.level = debug
rootLogger.appenderRef.console.ref = console

1
pom.xml

@ -46,6 +46,7 @@
<maven.compiler.release>8</maven.compiler.release> <maven.compiler.release>8</maven.compiler.release>
<slf4j.version>1.7.25</slf4j.version> <slf4j.version>1.7.25</slf4j.version>
<log4j.version>2.13.1</log4j.version>
<asm.version>7.1</asm.version> <asm.version>7.1</asm.version>
<junit.version>5.4.0</junit.version> <junit.version>5.4.0</junit.version>

Loading…
Cancel
Save