package logging
- Alphabetic
- By Inheritance
- logging
- LoggerLayers
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- final case class ConsoleLoggerConfig(format: LogFormat, filter: LogLevelByNameConfig) extends Product with Serializable
- final case class FileLoggerConfig(destination: Path, format: LogFormat, filter: LogLevelByNameConfig, charset: Charset = StandardCharsets.UTF_8, autoFlushBatchSize: Int = 1, bufferedIOSize: Option[Int] = None, rollingPolicy: Option[FileRollingPolicy] = None) extends Product with Serializable
- final case class FilteredLogger[Message, Output](logger: ZLogger[Message, Output], filter: LogFilter[Message]) extends ZLogger[Message, Option[Output]] with Product with Serializable
- final case class LogAnnotation[A](name: String, combine: (A, A) => A, render: (A) => String)(implicit evidence$1: Tag[A]) extends Product with Serializable
A
LogAnnotation
describes a particular type of statically-typed log annotation applied to log lines.A
LogAnnotation
describes a particular type of statically-typed log annotation applied to log lines. Log annotations combine in user-defined ways, which means they can have arbitrary structure. In the end, however, it must be possible to render each log annotation as a string.myEffect @@ UserId("jdoe")
- implicit final class LogAnnotationZIOSyntax[R, E, A] extends AnyRef
- final case class LogColor extends AnyVal with Product with Serializable
- final case class LogContext extends Product with Serializable
A
LogContext
stores context associated with logging operations. - sealed trait LogFilter[-Message] extends AnyRef
A
LogFilter
represents function/conditions for log filtering - sealed trait LogFormat extends AnyRef
A LogFormat represents a DSL to describe the format of text log messages.
A LogFormat represents a DSL to describe the format of text log messages.
import zio.logging.LogFormat._ timestamp.fixed(32) |-| level |-| label("message", quoted(line))
- sealed trait LogGroup[-Message, Out] extends AnyRef
- sealed trait LoggerNameExtractor extends AnyRef
- final case class MetricLogger(counter: Counter[Long], logLevelLabel: String) extends ZLogger[String, Unit] with Product with Serializable
- sealed trait ReconfigurableLogger[-Message, +Output, Config] extends ZLogger[Message, Output]
- implicit final class ZLoggerOps[-Message, +Output] extends AnyRef
- implicit final class ZLoggerZIOLayerOps[RIn, +E, ROut <: ZLogger[String, Any]] extends AnyRef
- Definition Classes
- LoggerLayers
Value Members
- def consoleErrJsonLogger(configPath: NonEmptyChunk[String] = loggerConfigPath): ZLayer[Any, Error, Unit]
- Definition Classes
- LoggerLayers
- def consoleErrJsonLogger(config: ConsoleLoggerConfig): ZLayer[Any, Nothing, Unit]
- Definition Classes
- LoggerLayers
- def consoleErrLogger(configPath: NonEmptyChunk[String] = loggerConfigPath): ZLayer[Any, Error, Unit]
- Definition Classes
- LoggerLayers
- def consoleErrLogger(config: ConsoleLoggerConfig): ZLayer[Any, Nothing, Unit]
- Definition Classes
- LoggerLayers
- def consoleJsonLogger(configPath: NonEmptyChunk[String] = loggerConfigPath): ZLayer[Any, Error, Unit]
- Definition Classes
- LoggerLayers
- def consoleJsonLogger(config: ConsoleLoggerConfig): ZLayer[Any, Nothing, Unit]
- Definition Classes
- LoggerLayers
- def consoleLogger(configPath: NonEmptyChunk[String] = loggerConfigPath): ZLayer[Any, Error, Unit]
- Definition Classes
- LoggerLayers
- def consoleLogger(config: ConsoleLoggerConfig): ZLayer[Any, Nothing, Unit]
- Definition Classes
- LoggerLayers
- def fileAsyncJsonLogger(configPath: NonEmptyChunk[String] = loggerConfigPath): ZLayer[Any, Error, Unit]
- Definition Classes
- LoggerLayers
- def fileAsyncJsonLogger(config: FileLoggerConfig): ZLayer[Any, Nothing, Unit]
- Definition Classes
- LoggerLayers
- def fileAsyncLogger(configPath: NonEmptyChunk[String] = loggerConfigPath): ZLayer[Any, Error, Unit]
- Definition Classes
- LoggerLayers
- def fileAsyncLogger(config: FileLoggerConfig): ZLayer[Any, Nothing, Unit]
- Definition Classes
- LoggerLayers
- def fileJsonLogger(configPath: NonEmptyChunk[String] = loggerConfigPath): ZLayer[Any, Error, Unit]
- Definition Classes
- LoggerLayers
- def fileJsonLogger(config: FileLoggerConfig): ZLayer[Any, Nothing, Unit]
- Definition Classes
- LoggerLayers
- def fileLogger(configPath: NonEmptyChunk[String] = loggerConfigPath): ZLayer[Any, Error, Unit]
- Definition Classes
- LoggerLayers
- def fileLogger(config: FileLoggerConfig): ZLayer[Any, Nothing, Unit]
- Definition Classes
- LoggerLayers
- val logContext: FiberRef[LogContext]
The logContext fiber reference is used to store typed, structured log annotations, which can be utilized by backends to enrich log messages.
The logContext fiber reference is used to store typed, structured log annotations, which can be utilized by backends to enrich log messages.
Because logContext is an ordinary zio.FiberRef, it may be get, set, and updated like any other fiber reference. However, the idiomatic way to interact with logContext is by using zio.logging.LogAnnotation.
For example:
myResponseHandler(request) @@ UserId(request.userId)
This code would add the structured log annotation LogAnnotation.UserId to all log messages emitted by the
myResponseHandler(request)
effect. - val logMetrics: ZLayer[Any, Nothing, Unit]
- Definition Classes
- LoggerLayers
- def logMetricsWith(name: String, logLevelLabel: String): ZLayer[Any, Nothing, Unit]
- Definition Classes
- LoggerLayers
- val loggerConfigPath: NonEmptyChunk[String]
- def loggerName(value: String): ZIOAspect[Nothing, Any, Nothing, Any, Nothing, Any]
Logger name aspect, by this aspect is possible to set logger name (in general, logger name is extracted from Trace)
Logger name aspect, by this aspect is possible to set logger name (in general, logger name is extracted from Trace)
annotation key: zio.logging.loggerNameAnnotationKey
- val loggerNameAnnotationKey: String
log aspect annotation key for logger name
- def makeConsoleErrJsonLogger(config: ConsoleLoggerConfig): ZIO[Any, Nothing, ZLogger[String, Any]]
- Definition Classes
- LoggerLayers
- def makeConsoleErrLogger(config: ConsoleLoggerConfig): ZIO[Any, Nothing, ZLogger[String, Any]]
- Definition Classes
- LoggerLayers
- def makeConsoleJsonLogger(config: ConsoleLoggerConfig): ZIO[Any, Nothing, ZLogger[String, Any]]
- Definition Classes
- LoggerLayers
- def makeConsoleLogger(config: ConsoleLoggerConfig): ZIO[Any, Nothing, ZLogger[String, Any]]
- Definition Classes
- LoggerLayers
- def makeFileAsyncJsonLogger(config: FileLoggerConfig): ZIO[Scope, Nothing, FilteredLogger[String, Any]]
- Definition Classes
- LoggerLayers
- def makeFileAsyncLogger(destination: Path, logger: ZLogger[String, String], charset: Charset, autoFlushBatchSize: Int, bufferedIOSize: Option[Int], rollingPolicy: Option[FileRollingPolicy]): ZIO[Scope, Nothing, ZLogger[String, Any]]
- Definition Classes
- LoggerLayers
- def makeFileAsyncLogger(config: FileLoggerConfig): ZIO[Scope, Nothing, FilteredLogger[String, Any]]
- Definition Classes
- LoggerLayers
- def makeFileJsonLogger(config: FileLoggerConfig): ZIO[Any, Nothing, FilteredLogger[String, Any]]
- Definition Classes
- LoggerLayers
- def makeFileLogger(destination: Path, logger: ZLogger[String, String], charset: Charset, autoFlushBatchSize: Int, bufferedIOSize: Option[Int], rollingPolicy: Option[FileRollingPolicy]): ZIO[Any, Nothing, ZLogger[String, Any]]
- Definition Classes
- LoggerLayers
- def makeFileLogger(config: FileLoggerConfig): ZIO[Any, Nothing, FilteredLogger[String, Any]]
- Definition Classes
- LoggerLayers
- def makeMetricLogger(counter: Counter[Long], logLevelLabel: String): ZIO[Any, Nothing, MetricLogger]
- Definition Classes
- LoggerLayers
- def makePrintStreamLogger(logger: ZLogger[String, String], stream: PrintStream): ZIO[Any, Nothing, ZLogger[String, Any]]
- Definition Classes
- LoggerLayers
- def makeSystemErrLogger(logger: ZLogger[String, String]): ZIO[Any, Nothing, ZLogger[String, Any]]
- Definition Classes
- LoggerLayers
- def makeSystemOutLogger(logger: ZLogger[String, String]): ZIO[Any, Nothing, ZLogger[String, Any]]
- Definition Classes
- LoggerLayers
- object ConsoleLoggerConfig extends Serializable
- object FileLoggerConfig extends Serializable
- object LogAnnotation extends Serializable
- object LogColor extends Serializable
- object LogContext extends Serializable
- object LogFilter
- object LogFormat
- object LogGroup
- object LoggerNameExtractor
- object ReconfigurableLogger