use of com.adaptris.util.stream.Slf4jLoggingOutputStream in project interlok by adaptris.
the class StandardHttpProducer method fail.
private void fail(int responseCode, InputStreamWithEncoding data) throws ProduceException {
if (log.isTraceEnabled()) {
try {
try (OutputStream slf4j = new Slf4jLoggingOutputStream(log, Slf4jLoggingOutputStream.LogLevel.TRACE);
InputStream in = new BufferedInputStream(data.inputStream);
PrintStream out = data.encoding == null ? new PrintStream(slf4j) : new PrintStream(slf4j, false, data.encoding)) {
out.println("Error Data from remote server :");
IOUtils.copy(in, out);
}
} catch (IOException e) {
log.trace("No Error Data available");
}
}
throw new ProduceException("Failed to send payload, got " + responseCode);
}
use of com.adaptris.util.stream.Slf4jLoggingOutputStream in project interlok by adaptris.
the class DebugPoolFactory method create.
@Override
public ComboPooledDataSource create() throws Exception {
ComboPooledDataSource result = super.create();
result.setUnreturnedConnectionTimeout(unreturnedConnectionTimeout());
result.setDebugUnreturnedConnectionStackTraces(debugUnreturnedConnectionStackTraces());
// lgtm
result.setLogWriter(new PrintWriter(new Slf4jLoggingOutputStream(logger, "DEBUG"), true));
return result;
}
Aggregations