← ZIO Logging docs

zio.logging

package zio.logging

Members list

Type members

Classlikes

Attributes

Companion
class
Source
ConsoleLoggerConfig.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
final case class ConsoleLoggerConfig(format: LogFormat, filter: LogLevelByNameConfig)

Attributes

Companion
object
Source
ConsoleLoggerConfig.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Source
FileLoggerConfig.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
final case class FileLoggerConfig(destination: Path, format: LogFormat, filter: LogLevelByNameConfig, charset: Charset = ..., autoFlushBatchSize: Int = ..., bufferedIOSize: Option[Int] = ..., rollingPolicy: Option[FileRollingPolicy] = ...)

Attributes

Companion
object
Source
FileLoggerConfig.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class FilteredLogger[Message, Output](logger: ZLogger[Message, Output], filter: LogFilter[Message]) extends ZLogger[Message, Option[Output]]

Attributes

Source
FilteredLogger.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait ZLogger[Message, Option[Output]]
class Object
trait Matchable
class Any
Show all
object LogAnnotation

Attributes

Companion
class
Source
LogAnnotation.scala
Supertypes
class Object
trait Matchable
class Any
Self type
final case class LogAnnotation[A](name: String, combine: (A, A) => A, render: A => String)(using evidence$1: Tag[A])

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.

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")

Attributes

Companion
object
Source
LogAnnotation.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Self type
final case class LogColor extends AnyVal

Attributes

Companion
object
Source
LogColor.scala
Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
object LogColor

Attributes

Companion
class
Source
LogColor.scala
Supertypes
class Object
trait Matchable
class Any
Self type
LogColor.type
final case class LogContext

A LogContext stores context associated with logging operations.

A LogContext stores context associated with logging operations.

Attributes

Companion
object
Source
LogContext.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Self type
object LogContext

Attributes

Companion
class
Source
LogContext.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
LogContext.type
object LogFilter

Attributes

Companion
trait
Source
LogFilter.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
LogFilter.type
sealed trait LogFilter[-Message]

A LogFilter represents function/conditions for log filtering

A LogFilter represents function/conditions for log filtering

Attributes

Companion
object
Source
LogFilter.scala
Supertypes
class Object
trait Matchable
class Any
Self type
LogFilter[Message]
sealed trait LogFormat

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))

Attributes

Companion
object
Source
LogFormat.scala
Supertypes
class Object
trait Matchable
class Any
Self type
object LogFormat

Attributes

Companion
trait
Source
LogFormat.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
LogFormat.type
sealed trait LogGroup[-Message, Out]

Attributes

Companion
object
Source
LogGroup.scala
Supertypes
class Object
trait Matchable
class Any
Self type
LogGroup[Message, Out]
object LogGroup

Attributes

Companion
trait
Source
LogGroup.scala
Supertypes
class Object
trait Matchable
class Any
Self type
LogGroup.type
sealed trait LoggerNameExtractor

Attributes

Companion
object
Source
LoggerNameExtractor.scala
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Companion
trait
Source
LoggerNameExtractor.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
final case class MetricLogger(counter: Counter[Long], logLevelLabel: String) extends ZLogger[String, Unit]

Attributes

Source
MetricLogger.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait ZLogger[String, Unit]
class Object
trait Matchable
class Any
Show all
sealed trait ReconfigurableLogger[-Message, +Output, Config] extends ZLogger[Message, Output]

Attributes

Companion
object
Source
ReconfigurableLogger.scala
Supertypes
trait ZLogger[Message, Output]
class Object
trait Matchable
class Any

Attributes

Companion
trait
Source
ReconfigurableLogger.scala
Supertypes
class Object
trait Matchable
class Any
Self type

Inherited classlikes

final implicit class LogAnnotationZIOSyntax[R, E, A](self: ZIO[R, E, A])

Attributes

Inherited from:
LoggingPackageAllPlatforms (hidden)
Source
LoggingPackageAllPlatforms.scala
Supertypes
class Object
trait Matchable
class Any
final implicit class ZLoggerOps[-Message, +Output](self: ZLogger[Message, Output])

Attributes

Inherited from:
LoggingPackageAllPlatforms (hidden)
Source
LoggingPackageAllPlatforms.scala
Supertypes
class Object
trait Matchable
class Any
final implicit class ZLoggerZIOLayerOps[RIn, +E, ROut <: ZLogger[String, Any]](self: ZIO[RIn, E, ROut])(using evidence$1: Tag[ROut])

Attributes

Inherited from:
LoggerLayers (hidden)
Source
LoggerLayers.scala
Supertypes
class Object
trait Matchable
class Any

Value members

Inherited methods

def appendLoggerName(value: String): ZIOAspect[Nothing, Any, Nothing, Any, Nothing, Any]

Append logger name aspect, by which it is possible to append a logger name to the current logger name. The new name is appended using a dot (.) as the delimiter.

Append logger name aspect, by which it is possible to append a logger name to the current logger name. The new name is appended using a dot (.) as the delimiter.

annotation key: zio.logging.loggerNameAnnotationKey

Attributes

Inherited from:
LoggingPackageAllPlatforms (hidden)
Source
LoggingPackageAllPlatforms.scala
def consoleErrJsonLogger(configPath: NonEmptyChunk[String] = ...): ZLayer[Any, Error, Unit]

Attributes

Inherited from:
LoggerLayers (hidden)
Source
LoggerLayers.scala
def consoleErrLogger(configPath: NonEmptyChunk[String] = ...): ZLayer[Any, Error, Unit]

Attributes

Inherited from:
LoggerLayers (hidden)
Source
LoggerLayers.scala
def consoleJsonLogger(configPath: NonEmptyChunk[String] = ...): ZLayer[Any, Error, Unit]

Attributes

Inherited from:
LoggerLayers (hidden)
Source
LoggerLayers.scala
def consoleLogger(configPath: NonEmptyChunk[String] = ...): ZLayer[Any, Error, Unit]

Attributes

Inherited from:
LoggerLayers (hidden)
Source
LoggerLayers.scala
def fileAsyncJsonLogger(configPath: NonEmptyChunk[String] = ...): ZLayer[Any, Error, Unit]

Attributes

Inherited from:
FileLoggerLayers (hidden)
Source
FileLoggerLayers.scala
def fileAsyncLogger(configPath: NonEmptyChunk[String] = ...): ZLayer[Any, Error, Unit]

Attributes

Inherited from:
FileLoggerLayers (hidden)
Source
FileLoggerLayers.scala
def fileJsonLogger(configPath: NonEmptyChunk[String] = ...): ZLayer[Any, Error, Unit]

Attributes

Inherited from:
FileLoggerLayers (hidden)
Source
FileLoggerLayers.scala
def fileLogger(configPath: NonEmptyChunk[String] = ...): ZLayer[Any, Error, Unit]

Attributes

Inherited from:
FileLoggerLayers (hidden)
Source
FileLoggerLayers.scala
def logMetricsWith(name: String, logLevelLabel: String): ZLayer[Any, Nothing, Unit]

Attributes

Inherited from:
LoggerLayers (hidden)
Source
LoggerLayers.scala
def loggerName(fn: Option[String] => 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

Attributes

Inherited from:
LoggingPackageAllPlatforms (hidden)
Source
LoggingPackageAllPlatforms.scala
def makeConsoleErrJsonLogger(config: ConsoleLoggerConfig): ZIO[Any, Nothing, ZLogger[String, Any]]

Attributes

Inherited from:
LoggerLayers (hidden)
Source
LoggerLayers.scala
def makeConsoleErrLogger(config: ConsoleLoggerConfig): ZIO[Any, Nothing, ZLogger[String, Any]]

Attributes

Inherited from:
LoggerLayers (hidden)
Source
LoggerLayers.scala
def makeConsoleJsonLogger(config: ConsoleLoggerConfig): ZIO[Any, Nothing, ZLogger[String, Any]]

Attributes

Inherited from:
LoggerLayers (hidden)
Source
LoggerLayers.scala
def makeConsoleLogger(config: ConsoleLoggerConfig): ZIO[Any, Nothing, ZLogger[String, Any]]

Attributes

Inherited from:
LoggerLayers (hidden)
Source
LoggerLayers.scala

Attributes

Inherited from:
FileLoggerLayers (hidden)
Source
FileLoggerLayers.scala
def makeFileAsyncLogger(destination: Path, logger: ZLogger[String, String], charset: Charset, autoFlushBatchSize: Int, bufferedIOSize: Option[Int], rollingPolicy: Option[FileRollingPolicy]): ZIO[Scope, Nothing, ZLogger[String, Any]]

Attributes

Inherited from:
FileLoggerLayers (hidden)
Source
FileLoggerLayers.scala
def makeFileJsonLogger(config: FileLoggerConfig): ZIO[Any, Nothing, FilteredLogger[String, Any]]

Attributes

Inherited from:
FileLoggerLayers (hidden)
Source
FileLoggerLayers.scala
def makeFileLogger(destination: Path, logger: ZLogger[String, String], charset: Charset, autoFlushBatchSize: Int, bufferedIOSize: Option[Int], rollingPolicy: Option[FileRollingPolicy]): ZIO[Any, Nothing, ZLogger[String, Any]]

Attributes

Inherited from:
FileLoggerLayers (hidden)
Source
FileLoggerLayers.scala
def makeMetricLogger(counter: Counter[Long], logLevelLabel: String): ZIO[Any, Nothing, MetricLogger]

Attributes

Inherited from:
LoggerLayers (hidden)
Source
LoggerLayers.scala
def makePrintStreamLogger(logger: ZLogger[String, String], stream: PrintStream): ZIO[Any, Nothing, ZLogger[String, Any]]

Attributes

Inherited from:
LoggerLayers (hidden)
Source
LoggerLayers.scala
def makeSystemErrLogger(logger: ZLogger[String, String]): ZIO[Any, Nothing, ZLogger[String, Any]]

Attributes

Inherited from:
LoggerLayers (hidden)
Source
LoggerLayers.scala
def makeSystemOutLogger(logger: ZLogger[String, String]): ZIO[Any, Nothing, ZLogger[String, Any]]

Attributes

Inherited from:
LoggerLayers (hidden)
Source
LoggerLayers.scala

Inherited fields

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.

Attributes

Inherited from:
LoggingPackageAllPlatforms (hidden)
Source
LoggingPackageAllPlatforms.scala
val logMetrics: ZLayer[Any, Nothing, Unit]

Attributes

Inherited from:
LoggerLayers (hidden)
Source
LoggerLayers.scala

Attributes

Inherited from:
LoggingPackageAllPlatforms (hidden)
Source
LoggingPackageAllPlatforms.scala

log aspect annotation key for logger name

log aspect annotation key for logger name

Attributes

Inherited from:
LoggingPackageAllPlatforms (hidden)
Source
LoggingPackageAllPlatforms.scala

Implicits

Inherited implicits

final implicit def LogAnnotationZIOSyntax[R, E, A](self: ZIO[R, E, A]): LogAnnotationZIOSyntax[R, E, A]

Attributes

Inherited from:
LoggingPackageAllPlatforms (hidden)
Source
LoggingPackageAllPlatforms.scala
final implicit def ZLoggerOps[Message, Output](self: ZLogger[Message, Output]): ZLoggerOps[Message, Output]

Attributes

Inherited from:
LoggingPackageAllPlatforms (hidden)
Source
LoggingPackageAllPlatforms.scala
final implicit def ZLoggerZIOLayerOps[RIn, E, ROut <: ZLogger[String, Any] : Tag](self: ZIO[RIn, E, ROut]): ZLoggerZIOLayerOps[RIn, E, ROut]

Attributes

Inherited from:
LoggerLayers (hidden)
Source
LoggerLayers.scala