develop #15
1
.gitignore
vendored
1
.gitignore
vendored
@ -4,3 +4,4 @@
|
|||||||
target/
|
target/
|
||||||
.idea/
|
.idea/
|
||||||
bin/
|
bin/
|
||||||
|
.idea
|
||||||
|
14
pom.xml
14
pom.xml
@ -9,7 +9,7 @@
|
|||||||
<description>Logger library for applications</description>
|
<description>Logger library for applications</description>
|
||||||
|
|
||||||
<scm>
|
<scm>
|
||||||
<url>https://gitea.locusworks.net/locusworks/app-logger.git</url>
|
<url>ssh://gitea@gitea.locusworks.net:7999/locusworks/app-logger.git</url>
|
||||||
</scm>
|
</scm>
|
||||||
<organization>
|
<organization>
|
||||||
<name>locusworks</name>
|
<name>locusworks</name>
|
||||||
@ -20,8 +20,8 @@
|
|||||||
<main.basedir>${project.basedir}</main.basedir>
|
<main.basedir>${project.basedir}</main.basedir>
|
||||||
<maven.compiler.source>1.8</maven.compiler.source>
|
<maven.compiler.source>1.8</maven.compiler.source>
|
||||||
<maven.compiler.target>1.8</maven.compiler.target>
|
<maven.compiler.target>1.8</maven.compiler.target>
|
||||||
<log4j.version>2.17.2</log4j.version>
|
<log4j.version>2.19.0</log4j.version>
|
||||||
<slf4j.version>1.7.36</slf4j.version>
|
<slf4j.version>2.0.1</slf4j.version>
|
||||||
<nexus.repo>https://nexus.locusworks.net</nexus.repo>
|
<nexus.repo>https://nexus.locusworks.net</nexus.repo>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
@ -30,7 +30,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
<version>3.0.0-M5</version>
|
<version>3.0.0-M7</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<forkMode>always</forkMode>
|
<forkMode>always</forkMode>
|
||||||
</configuration>
|
</configuration>
|
||||||
@ -38,7 +38,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.10.0</version>
|
<version>3.10.1</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<source>${maven.compiler.source}</source>
|
<source>${maven.compiler.source}</source>
|
||||||
<target>${maven.compiler.target}</target>
|
<target>${maven.compiler.target}</target>
|
||||||
@ -51,7 +51,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.owasp</groupId>
|
<groupId>org.owasp</groupId>
|
||||||
<artifactId>dependency-check-maven</artifactId>
|
<artifactId>dependency-check-maven</artifactId>
|
||||||
<version>7.0.0</version>
|
<version>7.2.0</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<goals>
|
<goals>
|
||||||
@ -63,7 +63,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-enforcer-plugin</artifactId>
|
<artifactId>maven-enforcer-plugin</artifactId>
|
||||||
<version>3.0.0</version>
|
<version>3.1.0</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>enforce</id>
|
<id>enforce</id>
|
||||||
|
@ -17,7 +17,7 @@ public class ApplicationLogger implements org.slf4j.Logger {
|
|||||||
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(ApplicationLogger.class);
|
private static final Logger logger = LoggerFactory.getLogger(ApplicationLogger.class);
|
||||||
|
|
||||||
private String name;
|
private final String name;
|
||||||
|
|
||||||
private LogLevel level;
|
private LogLevel level;
|
||||||
|
|
||||||
@ -588,7 +588,7 @@ public class ApplicationLogger implements org.slf4j.Logger {
|
|||||||
values.entrySet()
|
values.entrySet()
|
||||||
.stream()
|
.stream()
|
||||||
.map(entry -> String.format(format, entry.getKey(), entry.getValue()))
|
.map(entry -> String.format(format, entry.getKey(), entry.getValue()))
|
||||||
.forEach(s -> builder.append(s));
|
.forEach(builder::append);
|
||||||
|
|
||||||
log(level, builder.toString());
|
log(level, builder.toString());
|
||||||
}
|
}
|
||||||
@ -605,7 +605,7 @@ public class ApplicationLogger implements org.slf4j.Logger {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* helper method to format a message for logging
|
* helper method to format a message for logging
|
||||||
* @param level log level to use
|
* @param level level to use
|
||||||
* @param message message to log
|
* @param message message to log
|
||||||
* @param e any throwable to log
|
* @param e any throwable to log
|
||||||
*/
|
*/
|
||||||
|
@ -20,7 +20,7 @@ public class ApplicationLoggerFactory {
|
|||||||
* Need to get the log level from the properties file.
|
* Need to get the log level from the properties file.
|
||||||
* Would normally use the configuration service but would create a circular dependency as
|
* Would normally use the configuration service but would create a circular dependency as
|
||||||
* the configuration service use the ApplicationLoggerFactory to create a logger
|
* the configuration service use the ApplicationLoggerFactory to create a logger
|
||||||
* @param initializer The initializer
|
* @param init The initializer
|
||||||
*/
|
*/
|
||||||
public static void init(ApplicationLoggerInitializer init) {
|
public static void init(ApplicationLoggerInitializer init) {
|
||||||
initializer = init;
|
initializer = init;
|
||||||
|
Reference in New Issue
Block a user