com.teambytes.cloudwatch.appenders.logback.CloudwatchSimpleDataAppender.scala Maven / Gradle / Ivy
The newest version!
package com.teambytes.cloudwatch.appenders.logback
import ch.qos.logback.classic.spi.ILoggingEvent
class CloudwatchSimpleDataAppender extends CloudwatchAppender {
def append(event: ILoggingEvent): Unit = {
try {
val message = Option(layout).map(_.doLayout(event)).getOrElse(event.getFormattedMessage)
sendEvent(message)
} catch {
case e: Exception =>
e.printStackTrace()
addError("Error while sending a message", e);
}
}
}