Log harmless exception in DEBUG level (#4156)
* Log harmless exception in DEBUG level * Log harmless exception in DEBUG level * Minor refactor to avoid default method
This commit is contained in:
parent
d38a8eaaa7
commit
9862fe023f
|
|
@ -51,5 +51,7 @@ public interface ILog {
|
|||
|
||||
void debug(String format, Object... arguments);
|
||||
|
||||
void debug(Throwable t, String format, Object... arguments);
|
||||
|
||||
void error(String format);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,6 +78,11 @@ public enum NoopLogger implements ILog {
|
|||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void debug(final Throwable t, final String format, final Object... arguments) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void error(String format) {
|
||||
|
||||
|
|
|
|||
|
|
@ -184,6 +184,12 @@ public class PatternLogger implements ILog {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void debug(final Throwable t, final String format, final Object... arguments) {
|
||||
if (isDebugEnable()) {
|
||||
logger(LogLevel.DEBUG, replaceParam(format, arguments), t);
|
||||
}
|
||||
}
|
||||
|
||||
String format(LogLevel level, String message, Throwable t) {
|
||||
LogEvent logEvent = new LogEvent(level, message, t, targetClass);
|
||||
|
|
|
|||
|
|
@ -46,7 +46,9 @@ public class ProtectiveShieldMatcher<T> extends ElementMatcher.Junction.Abstract
|
|||
try {
|
||||
return this.matcher.matches(target);
|
||||
} catch (Throwable t) {
|
||||
logger.warn(t, "Byte-buddy occurs exception when match type.");
|
||||
if (logger.isDebugEnable()) {
|
||||
logger.debug(t, "Byte-buddy occurs exception when match type.");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ collector.backend_service=${SW_AGENT_COLLECTOR_BACKEND_SERVICES:127.0.0.1:11800}
|
|||
logging.file_name=${SW_LOGGING_FILE_NAME:skywalking-api.log}
|
||||
|
||||
# Logging level
|
||||
logging.level=${SW_LOGGING_LEVEL:DEBUG}
|
||||
logging.level=${SW_LOGGING_LEVEL:INFO}
|
||||
|
||||
# Logging dir
|
||||
# logging.dir=${SW_LOGGING_DIR:""}
|
||||
|
|
|
|||
Loading…
Reference in New Issue