Compare commits
24 Commits
1.0.1-RELE
...
develop
Author | SHA1 | Date | |
---|---|---|---|
32fc117caf | |||
94dcaf508d | |||
ed3b02f439 | |||
8b4e67892a | |||
16b1df3dd6 | |||
0c4e4efea8 | |||
df50805038 | |||
a4c39918f0 | |||
55a2f620a1 | |||
b50eccc471 | |||
ecfdf202d8 | |||
43cffb3610 | |||
8575afe735 | |||
f5806348dc | |||
043e9e9075 | |||
1986831f2c | |||
9ac40b5922 | |||
77bd18b0f1 | |||
b91e7a9618 | |||
211196aca9 | |||
e30e2c8455 | |||
bf1b6497ef | |||
76d2898671 | |||
ef833be8f2 |
3
.gitignore
vendored
3
.gitignore
vendored
@ -2,3 +2,6 @@
|
|||||||
.classpath
|
.classpath
|
||||||
.settings/
|
.settings/
|
||||||
target/
|
target/
|
||||||
|
.idea/
|
||||||
|
bin/
|
||||||
|
.idea
|
||||||
|
10
Jenkinsfile
vendored
10
Jenkinsfile
vendored
@ -48,7 +48,7 @@ def init() {
|
|||||||
if (branch_name.indexOf('master')==0) build_type='master'
|
if (branch_name.indexOf('master')==0) build_type='master'
|
||||||
|
|
||||||
// common pipeline elements
|
// common pipeline elements
|
||||||
node('master') {
|
node() {
|
||||||
Initialize()
|
Initialize()
|
||||||
SetVersion(build_type)
|
SetVersion(build_type)
|
||||||
print_vars() // after SetVersion - all variables now defined
|
print_vars() // after SetVersion - all variables now defined
|
||||||
@ -57,16 +57,16 @@ def init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (branch_name.indexOf('develop')==0) {
|
if (branch_name.indexOf('develop')==0) {
|
||||||
node('master') {
|
node() {
|
||||||
Deploy();
|
Deploy();
|
||||||
}
|
}
|
||||||
} else if (branch_name.indexOf('release/')==0) {
|
} else if (branch_name.indexOf('release/')==0) {
|
||||||
node('master') {
|
node() {
|
||||||
Deploy();
|
Deploy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
node('master') {
|
node() {
|
||||||
set_result('SUCCESS')
|
set_result('SUCCESS')
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -183,4 +183,4 @@ def SetVersion( v ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return this
|
return this
|
||||||
|
58
pom.xml
58
pom.xml
@ -9,7 +9,7 @@
|
|||||||
<description>Logger library for applications</description>
|
<description>Logger library for applications</description>
|
||||||
|
|
||||||
<scm>
|
<scm>
|
||||||
<url>ssh://git@bitbucket.org:locus2k/applogger.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.13.0</log4j.version>
|
<log4j.version>2.19.0</log4j.version>
|
||||||
<slf4j.version>1.7.30</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,20 +30,54 @@
|
|||||||
<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>2.20.1</version>
|
<version>3.0.0-M7</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<forkMode>always</forkMode>
|
<forkMode>always</forkMode>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugin</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.7.0</version>
|
<version>3.10.1</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<source>1.8</source>
|
<source>${maven.compiler.source}</source>
|
||||||
<target>1.8</target>
|
<target>${maven.compiler.target}</target>
|
||||||
|
<failOnError>true</failOnError>
|
||||||
|
<compilerArgs>
|
||||||
|
<arg>-Xlint:all</arg>
|
||||||
|
</compilerArgs>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.owasp</groupId>
|
||||||
|
<artifactId>dependency-check-maven</artifactId>
|
||||||
|
<version>7.2.0</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>check</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-enforcer-plugin</artifactId>
|
||||||
|
<version>3.1.0</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>enforce</id>
|
||||||
|
<configuration>
|
||||||
|
<rules>
|
||||||
|
<DependencyConvergence />
|
||||||
|
</rules>
|
||||||
|
</configuration>
|
||||||
|
<goals>
|
||||||
|
<goal>enforce</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
@ -62,6 +96,12 @@
|
|||||||
<groupId>org.apache.logging.log4j</groupId>
|
<groupId>org.apache.logging.log4j</groupId>
|
||||||
<artifactId>log4j-slf4j-impl</artifactId>
|
<artifactId>log4j-slf4j-impl</artifactId>
|
||||||
<version>${log4j.version}</version>
|
<version>${log4j.version}</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>slf4j-api</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
@ -113,4 +153,4 @@
|
|||||||
</pluginRepository>
|
</pluginRepository>
|
||||||
</pluginRepositories>
|
</pluginRepositories>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
@ -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;
|
||||||
|
|
||||||
@ -471,7 +471,7 @@ public class ApplicationLogger implements org.slf4j.Logger {
|
|||||||
public void error(Map<String, String> values, String valueFormat, StringBuilder sb, Throwable e) {
|
public void error(Map<String, String> values, String valueFormat, StringBuilder sb, Throwable e) {
|
||||||
msgHelper(LogLevel.ERROR, values, valueFormat, sb);
|
msgHelper(LogLevel.ERROR, values, valueFormat, sb);
|
||||||
if (e != null) {
|
if (e != null) {
|
||||||
msgHelper(LogLevel.ERROR, "", e);
|
msgHelper(LogLevel.ERROR,"", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -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,9 +605,9 @@ 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
|
||||||
*/
|
*/
|
||||||
private void msgHelper(LogLevel level, String message, Throwable e) {
|
private void msgHelper(LogLevel level, String message, Throwable e) {
|
||||||
String msg = e == null ? String.format("%n%s", message) : String.format("%n%s%n%s%n%s", message, e.getMessage(), getStackTrace(e));
|
String msg = e == null ? String.format("%n%s", message) : String.format("%n%s%n%s%n%s", message, e.getMessage(), getStackTrace(e));
|
||||||
@ -622,4 +622,4 @@ public class ApplicationLogger implements org.slf4j.Logger {
|
|||||||
private String format(String message, LogLevel level) {
|
private String format(String message, LogLevel level) {
|
||||||
return String.format("th%06d [%-5s] [%s] %s", Thread.currentThread().getId(), level, this.name, message);
|
return String.format("th%06d [%-5s] [%s] %s", Thread.currentThread().getId(), level, this.name, message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
@ -214,4 +214,4 @@ public class ApplicationLoggerFactory {
|
|||||||
this.level = level;
|
this.level = level;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user