package logging
- Alphabetic
- Public
- Protected
Type Members
- final class Logger extends Serializable
A scala wrapper over a
org.slf4j.Logger
.A scala wrapper over a
org.slf4j.Logger
.The Logger extends java.io.Serializable to support it's usage through the com.twitter.util.logging.Logging trait when the trait is mixed into a java.io.Serializable class.
Note, logging methods have a call-by-name variation which are intended for use from Scala.
- Annotations
- @SerialVersionUID()
- trait Logging extends AnyRef
A scala-friendly Logging trait which:
A scala-friendly Logging trait which:
- lazily provides a logger named according to the class in which the trait is mixed
- convenience methods to proxy calls to the lazily provided logger. These methods are explicitly call-by-name as they are mainly intended for use from Scala.
class MyClass extends Logging { ... def foo: String = { info("In foo method") "Hello, world!" } }
For more information, see util-slf4j-api/README.md
- trait Slf4jBridge extends AnyRef
Installing the
SLF4JBridgeHandler
should be done as early as possible in order to capture any log statements emitted to JUL.Installing the
SLF4JBridgeHandler
should be done as early as possible in order to capture any log statements emitted to JUL. Generally it is best to install the handler in the constructor of the main class of your application.This trait can be mixed into a com.twitter.app.App type and will attempt to install the
SLF4JBridgeHandler
via the Slf4jBridgeUtility as part of the constructor of the resultant class.- See also
org.slf4j.bridge.SLF4JBridgeHandler
Value Members
- object Logger extends Serializable
Companion object for com.twitter.util.logging.Logger which provides factory methods for creation.
- object Slf4jBridgeUtility extends Logging
A utility to safely install the slf4j-api SLF4JBridgeHandler.
A utility to safely install the slf4j-api SLF4JBridgeHandler. The utility attempts to detect if the
slf4j-jdk14
dependency is present on the classpath as it is unwise to install thejul-to-slf4j
bridge with theslf4j-jdk14
dependency present as it may cause an infinite loop.If the SLF4JBridgeHandler is already installed we do not try to install it again.
Additionally note there is a performance impact for bridging jul log messages in this manner. However, using the Logback LevelChangePropagator (> 0.9.25) can eliminate this performance impact.
- See also
org.slf4j.bridge.SLF4JBridgeHandler