Updated libraries to fix vulnerabilities
This commit is contained in:
@ -17,7 +17,7 @@ public class ApplicationLogger implements org.slf4j.Logger {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(ApplicationLogger.class);
|
||||
|
||||
private String name;
|
||||
private final String name;
|
||||
|
||||
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) {
|
||||
msgHelper(LogLevel.ERROR, values, valueFormat, sb);
|
||||
if (e != null) {
|
||||
msgHelper(LogLevel.ERROR, "", e);
|
||||
msgHelper("", e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -588,7 +588,7 @@ public class ApplicationLogger implements org.slf4j.Logger {
|
||||
values.entrySet()
|
||||
.stream()
|
||||
.map(entry -> String.format(format, entry.getKey(), entry.getValue()))
|
||||
.forEach(s -> builder.append(s));
|
||||
.forEach(builder::append);
|
||||
|
||||
log(level, builder.toString());
|
||||
}
|
||||
@ -605,13 +605,13 @@ public class ApplicationLogger implements org.slf4j.Logger {
|
||||
|
||||
/**
|
||||
* helper method to format a message for logging
|
||||
* @param level log level to use
|
||||
*
|
||||
* @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(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));
|
||||
log(level, msg);
|
||||
log(LogLevel.ERROR, msg);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -622,4 +622,4 @@ public class ApplicationLogger implements org.slf4j.Logger {
|
||||
private String format(String message, LogLevel level) {
|
||||
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.
|
||||
* Would normally use the configuration service but would create a circular dependency as
|
||||
* the configuration service use the ApplicationLoggerFactory to create a logger
|
||||
* @param initializer The initializer
|
||||
* @param init The initializer
|
||||
*/
|
||||
public static void init(ApplicationLoggerInitializer init) {
|
||||
initializer = init;
|
||||
@ -214,4 +214,4 @@ public class ApplicationLoggerFactory {
|
||||
this.level = level;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user