package logging
- Alphabetic
- By Inheritance
- logging
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- final case class ConsoleLoggerConfig(format: LogFormat, filter: LogFilter[String]) extends Product with Serializable
- final case class FileLoggerConfig(destination: Path, format: LogFormat, filter: LogFilter[String], charset: Charset = StandardCharsets.UTF_8, autoFlushBatchSize: Int = 1, bufferedIOSize: Option[Int] = None) extends 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")
- 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 - 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))
- trait LogGroup[-Message, Out] extends AnyRef
- trait LoggerNameExtractor extends AnyRef
Value Members
- def consoleErrJsonLogger(configPath: String = "logger"): ZLayer[Any, Error, Unit]
- def consoleErrJsonLogger(config: ConsoleLoggerConfig): ZLayer[Any, Nothing, Unit]
- def consoleErrLogger(configPath: String = "logger"): ZLayer[Any, Error, Unit]
- def consoleErrLogger(config: ConsoleLoggerConfig): ZLayer[Any, Nothing, Unit]
- def consoleJsonLogger(configPath: String = "logger"): ZLayer[Any, Error, Unit]
- def consoleJsonLogger(config: ConsoleLoggerConfig): ZLayer[Any, Nothing, Unit]
- def consoleLogger(configPath: String = "logger"): ZLayer[Any, Error, Unit]
- def consoleLogger(config: ConsoleLoggerConfig): ZLayer[Any, Nothing, Unit]
- def fileAsyncJsonLogger(configPath: String = "logger"): ZLayer[Any, Error, Unit]
- def fileAsyncJsonLogger(config: FileLoggerConfig): ZLayer[Any, Nothing, Unit]
- def fileAsyncLogger(configPath: String = "logger"): ZLayer[Any, Error, Unit]
- def fileAsyncLogger(config: FileLoggerConfig): ZLayer[Any, Nothing, Unit]
- def fileJsonLogger(configPath: String = "logger"): ZLayer[Any, Error, Unit]
- def fileJsonLogger(config: FileLoggerConfig): ZLayer[Any, Nothing, Unit]
- def fileLogger(configPath: String = "logger"): ZLayer[Any, Error, Unit]
- def fileLogger(config: FileLoggerConfig): ZLayer[Any, Nothing, Unit]
- 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]
- def logMetricsWith(name: String, logLevelLabel: String): ZLayer[Any, Nothing, Unit]
- 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
- val removeDefaultLoggers: ZLayer[Any, Nothing, Unit]
- 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
Deprecated Value Members
- def console(format: LogFormat, logFilter: LogFilter[String]): ZLayer[Any, Nothing, Unit]
- Annotations
- @deprecated
- Deprecated
(Since version 2.1.10) use zio.logging.consoleLogger
- def console(format: LogFormat = LogFormat.colored, logLevel: LogLevel = LogLevel.Info): ZLayer[Any, Nothing, Unit]
- Annotations
- @deprecated
- Deprecated
(Since version 2.1.10) use zio.logging.consoleLogger
- def consoleErr(format: LogFormat, logFilter: LogFilter[String]): ZLayer[Any, Nothing, Unit]
- Annotations
- @deprecated
- Deprecated
(Since version 2.1.10) use zio.logging.consoleErrLogger
- def consoleErr(format: LogFormat = LogFormat.default, logLevel: LogLevel = LogLevel.Info): ZLayer[Any, Nothing, Unit]
- Annotations
- @deprecated
- Deprecated
(Since version 2.1.10) use zio.logging.consoleErrLogger
- def consoleErrJson(format: LogFormat, logFilter: LogFilter[String]): ZLayer[Any, Nothing, Unit]
- Annotations
- @deprecated
- Deprecated
(Since version 2.1.10) use zio.logging.consoleErrJsonLogger
- def consoleErrJson(format: LogFormat = LogFormat.default, logLevel: LogLevel = LogLevel.Info): ZLayer[Any, Nothing, Unit]
- Annotations
- @deprecated
- Deprecated
(Since version 2.1.10) use zio.logging.consoleErrJsonLogger
- def consoleJson(format: LogFormat, logFilter: LogFilter[String]): ZLayer[Any, Nothing, Unit]
- Annotations
- @deprecated
- Deprecated
(Since version 2.1.10) use zio.logging.consoleJsonLogger
- def consoleJson(format: LogFormat = LogFormat.default, logLevel: LogLevel = LogLevel.Info): ZLayer[Any, Nothing, Unit]
- Annotations
- @deprecated
- Deprecated
(Since version 2.1.10) use zio.logging.consoleJsonLogger
- def file(destination: Path, format: LogFormat, logFilter: LogFilter[String], charset: Charset, autoFlushBatchSize: Int, bufferedIOSize: Option[Int]): ZLayer[Any, Nothing, Unit]
- Annotations
- @deprecated
- Deprecated
(Since version 2.1.10) use zio.logging.fileLogger
- def file(destination: Path, format: LogFormat = LogFormat.default, logLevel: LogLevel = LogLevel.Info, charset: Charset = StandardCharsets.UTF_8, autoFlushBatchSize: Int = 1, bufferedIOSize: Option[Int] = None): ZLayer[Any, Nothing, Unit]
- Annotations
- @deprecated
- Deprecated
(Since version 2.1.10) use zio.logging.fileLogger
- def fileAsync(destination: Path, format: LogFormat, logFilter: LogFilter[String], charset: Charset, autoFlushBatchSize: Int, bufferedIOSize: Option[Int]): ZLayer[Any, Nothing, Unit]
- Annotations
- @deprecated
- Deprecated
(Since version 2.1.10) use zio.logging.fileAsyncLogger
- def fileAsync(destination: Path, format: LogFormat = LogFormat.default, logLevel: LogLevel = LogLevel.Info, charset: Charset = StandardCharsets.UTF_8, autoFlushBatchSize: Int = 1, bufferedIOSize: Option[Int] = None): ZLayer[Any, Nothing, Unit]
- Annotations
- @deprecated
- Deprecated
(Since version 2.1.10) use zio.logging.fileAsyncLogger
- def fileAsyncJson(destination: Path, format: LogFormat, logFilter: LogFilter[String], charset: Charset, autoFlushBatchSize: Int, bufferedIOSize: Option[Int]): ZLayer[Any, Nothing, Unit]
- Annotations
- @deprecated
- Deprecated
(Since version 2.1.10) use zio.logging.fileAsyncJsonLogger
- def fileAsyncJson(destination: Path, format: LogFormat = LogFormat.default, logLevel: LogLevel = LogLevel.Info, charset: Charset = StandardCharsets.UTF_8, autoFlushBatchSize: Int = 1, bufferedIOSize: Option[Int] = None): ZLayer[Any, Nothing, Unit]
- Annotations
- @deprecated
- Deprecated
(Since version 2.1.10) use zio.logging.fileAsyncJsonLogger
- def fileJson(destination: Path, format: LogFormat, logFilter: LogFilter[String], charset: Charset, autoFlushBatchSize: Int, bufferedIOSize: Option[Int]): ZLayer[Any, Nothing, Unit]
- Annotations
- @deprecated
- Deprecated
(Since version 2.1.10) use zio.logging.fileJsonLogger
- def fileJson(destination: Path, format: LogFormat = LogFormat.default, logLevel: LogLevel = LogLevel.Info, charset: Charset = StandardCharsets.UTF_8, autoFlushBatchSize: Int = 1, bufferedIOSize: Option[Int] = None): ZLayer[Any, Nothing, Unit]
- Annotations
- @deprecated
- Deprecated
(Since version 2.1.10) use zio.logging.fileJsonLogger