Seems like a fairly straight forward problem, but I\'d like to log a stack trace when my top level error handler in Scalatra is triggered. I\'m intentionally throwing an excepti
If you use the standard logger: com.typesafe.scalalogging.Logger , the logger prints the stack trace for you.
You can just use it this way:
import com.typesafe.scalalogging.Logger
import org.slf4j.LoggerFactory
try {
throw new Exception("test message")
} catch {
case e:Exception => logger.error("Exception " , e)
}
There is already an overload which is accepting 2 parameters, String and Throwable.