package logging
- Alphabetic
- Public
- All
Type Members
-
trait
BaseLogger extends Serializable
Base type for ContextAwareLogger and SamplingLogger.
-
final
case class
Chain(strategies: Seq[SamplingStrategy]) extends SamplingStrategy with Product with Serializable
Strategy that consists of a sequence of strategies combined together.
Strategy that consists of a sequence of strategies combined together. A message is logged if it can be logged according to all strategies called in order. A strategy down the chain won't be invoked if the message is skipped by an earlier strategy. This allows combining strategies together in a useful way, for instance limiting the frequency of a log message, and the total number of logged messages:
- strategies
The strategies in the chain.
import com.here.platform.pipeline.logging._ import concurrent.duration._ val strategy = Chain(Seq(OneWithin(5.seconds), Limit(10000)))
Example: -
class
ContextAwareLogger extends BaseLogger
Main context-aware logging class.
-
trait
ContextLogging extends AnyRef
Logger trait to be mixed in classes that need to perform the com.here.platform.pipeline.logging.LogContext aware logging.
Logger trait to be mixed in classes that need to perform the com.here.platform.pipeline.logging.LogContext aware logging.
- Note
The processing library only supports context aware logging.
-
final
case class
Limit(n: Int) extends SamplingStrategy with Product with Serializable
Strategy that logs only the first n messages.
Strategy that logs only the first n messages.
- n
The number of messages to log. Must be a positive number.
-
class
LogContext extends Serializable
This class implements the logging context concept that consists of a set of information to be appended to logging messages to give the user a clear understanding of the computational context where a given logging message comes from
This class implements the logging context concept that consists of a set of information to be appended to logging messages to give the user a clear understanding of the computational context where a given logging message comes from
With reference to logging please refer to the following message:
Logger: logging message // Context contextName=id childContextName=childId
- Note
This class is mainly meant to be used in conjunction with a ContextAwareLogger
-
final
case class
OneEvery(n: Int) extends SamplingStrategy with Product with Serializable
Strategy that logs one message every n.
Strategy that logs one message every n.
- n
Number of messages in a sampling period. Must be a positive number.
-
final
case class
OneWithin(timeWindow: FiniteDuration) extends SamplingStrategy with Product with Serializable
Strategy that only logs one message within a time window.
Strategy that only logs one message within a time window. The rest of the messages within the same time window are skipped.
- timeWindow
Duration of the time window. Must be non-empty.
-
class
SamplingLogger extends BaseLogger
A context-aware logger that filters the log messages based on a configurable com.here.platform.pipeline.logging.SamplingStrategy.
A context-aware logger that filters the log messages based on a configurable com.here.platform.pipeline.logging.SamplingStrategy. The sampling strategy is applied independently for each logger call site.
-
trait
SamplingStrategy extends Serializable
A sampling strategy for use together with a SamplingLogger.
-
trait
SamplingStrategyInstance extends AnyRef
Implementation of a SamplingStrategy for a specific call site.
Value Members
- object LogContext extends Serializable
-
object
RootLogContext extends LogContext
Empty root context which prints nothing (not even start/endContext in case there aren't any children)
- object SamplingLogger extends Serializable