Search in sources :

Example 1 with ExtendedThrowableProxyConverter

use of ch.qos.logback.classic.pattern.ExtendedThrowableProxyConverter in project sonarqube by SonarSource.

the class LogCallbackAppender method append.

@Override
protected void append(ILoggingEvent event) {
    if (event.getThrowableProxy() == null) {
        target.log(event.getFormattedMessage(), translate(event.getLevel()));
    } else {
        ExtendedThrowableProxyConverter throwableConverter = new ExtendedThrowableProxyConverter();
        throwableConverter.start();
        target.log(event.getFormattedMessage() + "\n" + throwableConverter.convert(event), translate(event.getLevel()));
        throwableConverter.stop();
    }
}
Also used : ExtendedThrowableProxyConverter(ch.qos.logback.classic.pattern.ExtendedThrowableProxyConverter)

Example 2 with ExtendedThrowableProxyConverter

use of ch.qos.logback.classic.pattern.ExtendedThrowableProxyConverter in project sonarlint-core by SonarSource.

the class LogCallbackAppender method append.

@Override
protected void append(ILoggingEvent event) {
    LogOutput target = tlTtarget.get();
    if (target == null) {
        defaultAppender.doAppend(event);
        return;
    }
    String msg;
    if (event.getThrowableProxy() == null) {
        msg = event.getFormattedMessage();
    } else {
        ExtendedThrowableProxyConverter throwableConverter = new ExtendedThrowableProxyConverter();
        throwableConverter.start();
        msg = event.getFormattedMessage() + "\n" + throwableConverter.convert(event);
        throwableConverter.stop();
    }
    handleErrors(event);
    target.log(msg, translate(event.getLevel()));
}
Also used : ExtendedThrowableProxyConverter(ch.qos.logback.classic.pattern.ExtendedThrowableProxyConverter) LogOutput(org.sonarsource.sonarlint.core.client.api.common.LogOutput)

Aggregations

ExtendedThrowableProxyConverter (ch.qos.logback.classic.pattern.ExtendedThrowableProxyConverter)2 LogOutput (org.sonarsource.sonarlint.core.client.api.common.LogOutput)1