use of org.apache.logging.log4j.core.LogEvent in project cas by apereo.
the class CloudWatchAppender method append.
@Override
public void append(final LogEvent logEvent) {
final LogEvent event = LoggingUtils.prepareLogEvent(logEvent);
final InputLogEvent awsLogEvent = new InputLogEvent();
final long timestamp = event.getTimeMillis();
final String message = new String(getLayout().toByteArray(event));
awsLogEvent.setTimestamp(timestamp);
awsLogEvent.setMessage(message);
if (!queue.offer(awsLogEvent) && !queueFull) {
queueFull = true;
} else if (queueFull) {
queueFull = false;
}
}
use of org.apache.logging.log4j.core.LogEvent in project spring-boot by spring-projects.
the class ExtendedWhitespaceThrowablePatternConverterTests method withStackTrace.
@Test
public void withStackTrace() throws Exception {
LogEvent event = Log4jLogEvent.newBuilder().setThrown(new Exception()).build();
StringBuilder builder = new StringBuilder();
this.converter.format(event, builder);
assertThat(builder).startsWith(LINE_SEPARATOR).endsWith(LINE_SEPARATOR);
}
use of org.apache.logging.log4j.core.LogEvent in project spring-boot by spring-projects.
the class ExtendedWhitespaceThrowablePatternConverterTests method noStackTrace.
@Test
public void noStackTrace() throws Exception {
LogEvent event = Log4jLogEvent.newBuilder().build();
StringBuilder builder = new StringBuilder();
this.converter.format(event, builder);
assertThat(builder.toString()).isEqualTo("");
}
use of org.apache.logging.log4j.core.LogEvent in project spring-boot by spring-projects.
the class WhitespaceThrowablePatternConverterTests method noStackTrace.
@Test
public void noStackTrace() throws Exception {
LogEvent event = Log4jLogEvent.newBuilder().build();
StringBuilder builder = new StringBuilder();
this.converter.format(event, builder);
assertThat(builder.toString()).isEqualTo("");
}
use of org.apache.logging.log4j.core.LogEvent in project spring-boot by spring-projects.
the class WhitespaceThrowablePatternConverterTests method withStackTrace.
@Test
public void withStackTrace() throws Exception {
LogEvent event = Log4jLogEvent.newBuilder().setThrown(new Exception()).build();
StringBuilder builder = new StringBuilder();
this.converter.format(event, builder);
assertThat(builder.toString()).startsWith(LINE_SEPARATOR).endsWith(LINE_SEPARATOR);
}
Aggregations