org.apache.logging.log4j.scala

Logger

final class Logger extends AnyVal

Scala wrapper for the Log4j Logger interface.

Frequently the purpose of logging is to provide information about what is happening in the system, which requires including information about the objects being manipulated. In Scala, you can use string interpolation to achieve this:

logger.debug(s"Logging in user ${user.getName} with birthday ${user.calcBirthday}")

Since this wrapper is implemented with macros, the String construction and method invocations will only occur when debug logging is enabled.

Linear Supertypes
AnyVal, NotNull, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Logger
  2. AnyVal
  3. NotNull
  4. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  2. final def ##(): Int

    Definition Classes
    Any
  3. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  4. def apply(level: Level, message: AnyRef, cause: Throwable): Unit

    Logs an object at the given Level including the stack trace of the given Throwable.

    Logs an object at the given Level including the stack trace of the given Throwable.

    level

    the logging level

    message

    the message to be logged

    cause

    a Throwable

    Annotations
    @macroImpl( ... )
  5. def apply(level: Level, message: CharSequence, cause: Throwable): Unit

    Logs a string at the given Level including the stack trace of the given Throwable.

    Logs a string at the given Level including the stack trace of the given Throwable.

    level

    the logging level

    message

    the message to be logged

    cause

    a Throwable

    Annotations
    @macroImpl( ... )
  6. def apply(level: Level, message: Message, cause: Throwable): Unit

    Logs a Message at the given Level including the stack trace of the given Throwable.

    Logs a Message at the given Level including the stack trace of the given Throwable.

    level

    the logging level

    message

    the message to be logged

    cause

    a Throwable

    Annotations
    @macroImpl( ... )
  7. def apply(level: Level, message: AnyRef): Unit

    Logs an object at the given Level.

    Logs an object at the given Level.

    level

    the logging level

    message

    the message to be logged

    Annotations
    @macroImpl( ... )
  8. def apply(level: Level, message: CharSequence): Unit

    Logs a string at the given Level.

    Logs a string at the given Level.

    level

    the logging level

    message

    the message to be logged

    Annotations
    @macroImpl( ... )
  9. def apply(level: Level, message: Message): Unit

    Logs a Message at the given Level.

    Logs a Message at the given Level.

    level

    the logging level

    message

    the message to be logged

    Annotations
    @macroImpl( ... )
  10. def apply(level: Level, marker: Marker, message: AnyRef, cause: Throwable): Unit

    Logs an object with the specific Marker at the given Level including the stack trace of the given Throwable.

    Logs an object with the specific Marker at the given Level including the stack trace of the given Throwable.

    level

    the logging level

    marker

    the marker data specific to this log statement

    message

    the message to be logged

    cause

    the cause

    Annotations
    @macroImpl( ... )
  11. def apply(level: Level, marker: Marker, message: CharSequence, cause: Throwable): Unit

    Logs a string with the specific Marker at the given Level including the stack trace of the given Throwable.

    Logs a string with the specific Marker at the given Level including the stack trace of the given Throwable.

    level

    the logging level

    marker

    the marker data specific to this log statement

    message

    the message to be logged

    cause

    the cause

    Annotations
    @macroImpl( ... )
  12. def apply(level: Level, marker: Marker, message: Message, cause: Throwable): Unit

    Logs a Message with the specific Marker at the given Level including the stack trace of the given Throwable.

    Logs a Message with the specific Marker at the given Level including the stack trace of the given Throwable.

    level

    the logging level

    marker

    the marker data specific to this log statement

    message

    the message to be logged

    cause

    the cause

    Annotations
    @macroImpl( ... )
  13. def apply(level: Level, marker: Marker, message: AnyRef): Unit

    Logs an object with the specific Marker at the given Level.

    Logs an object with the specific Marker at the given Level.

    level

    the logging level

    marker

    the marker data specific to this log statement

    message

    the message to be logged

    Annotations
    @macroImpl( ... )
  14. def apply(level: Level, marker: Marker, message: CharSequence): Unit

    Logs a string with the specific Marker at the given Level.

    Logs a string with the specific Marker at the given Level.

    level

    the logging level

    marker

    the marker data specific to this log statement

    message

    the message to be logged

    Annotations
    @macroImpl( ... )
  15. def apply(level: Level, marker: Marker, message: Message): Unit

    Logs a Message with the specific Marker at the given Level.

    Logs a Message with the specific Marker at the given Level.

    level

    the logging level

    marker

    the marker data specific to this log statement

    message

    the message to be logged

    Annotations
    @macroImpl( ... )
  16. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  17. def catching(level: Level, t: Throwable): Unit

    Logs an exception or error that has been caught to a specific logging level.

    Logs an exception or error that has been caught to a specific logging level.

    level

    The logging Level.

    t

    The Throwable.

    Annotations
    @macroImpl( ... )
  18. def catching(t: Throwable): Unit

    Logs an exception or error that has been caught.

    Logs an exception or error that has been caught.

    t

    the Throwable.

    Annotations
    @macroImpl( ... )
  19. def debug(message: AnyRef, cause: Throwable): Unit

    Annotations
    @macroImpl( ... )
  20. def debug(message: CharSequence, cause: Throwable): Unit

    Annotations
    @macroImpl( ... )
  21. def debug(message: Message, cause: Throwable): Unit

    Annotations
    @macroImpl( ... )
  22. def debug(message: AnyRef): Unit

    Annotations
    @macroImpl( ... )
  23. def debug(message: CharSequence): Unit

    Annotations
    @macroImpl( ... )
  24. def debug(message: Message): Unit

    Annotations
    @macroImpl( ... )
  25. def debug(marker: Marker, message: AnyRef, cause: Throwable): Unit

    Annotations
    @macroImpl( ... )
  26. def debug(marker: Marker, message: CharSequence, cause: Throwable): Unit

    Annotations
    @macroImpl( ... )
  27. def debug(marker: Marker, message: Message, cause: Throwable): Unit

    Annotations
    @macroImpl( ... )
  28. def debug(marker: Marker, message: AnyRef): Unit

    Annotations
    @macroImpl( ... )
  29. def debug(marker: Marker, message: CharSequence): Unit

    Annotations
    @macroImpl( ... )
  30. def debug(marker: Marker, message: Message): Unit

    Annotations
    @macroImpl( ... )
  31. val delegate: ExtendedLogger

  32. def error(message: AnyRef, cause: Throwable): Unit

    Annotations
    @macroImpl( ... )
  33. def error(message: CharSequence, cause: Throwable): Unit

    Annotations
    @macroImpl( ... )
  34. def error(message: Message, cause: Throwable): Unit

    Annotations
    @macroImpl( ... )
  35. def error(message: AnyRef): Unit

    Annotations
    @macroImpl( ... )
  36. def error(message: CharSequence): Unit

    Annotations
    @macroImpl( ... )
  37. def error(message: Message): Unit

    Annotations
    @macroImpl( ... )
  38. def error(marker: Marker, message: AnyRef, cause: Throwable): Unit

    Annotations
    @macroImpl( ... )
  39. def error(marker: Marker, message: CharSequence, cause: Throwable): Unit

    Annotations
    @macroImpl( ... )
  40. def error(marker: Marker, message: Message, cause: Throwable): Unit

    Annotations
    @macroImpl( ... )
  41. def error(marker: Marker, message: AnyRef): Unit

    Annotations
    @macroImpl( ... )
  42. def error(marker: Marker, message: CharSequence): Unit

    Annotations
    @macroImpl( ... )
  43. def error(marker: Marker, message: Message): Unit

    Annotations
    @macroImpl( ... )
  44. def fatal(message: AnyRef, cause: Throwable): Unit

    Annotations
    @macroImpl( ... )
  45. def fatal(message: CharSequence, cause: Throwable): Unit

    Annotations
    @macroImpl( ... )
  46. def fatal(message: Message, cause: Throwable): Unit

    Annotations
    @macroImpl( ... )
  47. def fatal(message: AnyRef): Unit

    Annotations
    @macroImpl( ... )
  48. def fatal(message: CharSequence): Unit

    Annotations
    @macroImpl( ... )
  49. def fatal(message: Message): Unit

    Annotations
    @macroImpl( ... )
  50. def fatal(marker: Marker, message: AnyRef, cause: Throwable): Unit

    Annotations
    @macroImpl( ... )
  51. def fatal(marker: Marker, message: CharSequence, cause: Throwable): Unit

    Annotations
    @macroImpl( ... )
  52. def fatal(marker: Marker, message: Message, cause: Throwable): Unit

    Annotations
    @macroImpl( ... )
  53. def fatal(marker: Marker, message: AnyRef): Unit

    Annotations
    @macroImpl( ... )
  54. def fatal(marker: Marker, message: CharSequence): Unit

    Annotations
    @macroImpl( ... )
  55. def fatal(marker: Marker, message: Message): Unit

    Annotations
    @macroImpl( ... )
  56. def getClass(): Class[_ <: AnyVal]

    Definition Classes
    AnyVal → Any
  57. def info(message: AnyRef, cause: Throwable): Unit

    Annotations
    @macroImpl( ... )
  58. def info(message: CharSequence, cause: Throwable): Unit

    Annotations
    @macroImpl( ... )
  59. def info(message: Message, cause: Throwable): Unit

    Annotations
    @macroImpl( ... )
  60. def info(message: AnyRef): Unit

    Annotations
    @macroImpl( ... )
  61. def info(message: CharSequence): Unit

    Annotations
    @macroImpl( ... )
  62. def info(message: Message): Unit

    Annotations
    @macroImpl( ... )
  63. def info(marker: Marker, message: AnyRef, cause: Throwable): Unit

    Annotations
    @macroImpl( ... )
  64. def info(marker: Marker, message: CharSequence, cause: Throwable): Unit

    Annotations
    @macroImpl( ... )
  65. def info(marker: Marker, message: Message, cause: Throwable): Unit

    Annotations
    @macroImpl( ... )
  66. def info(marker: Marker, message: AnyRef): Unit

    Annotations
    @macroImpl( ... )
  67. def info(marker: Marker, message: CharSequence): Unit

    Annotations
    @macroImpl( ... )
  68. def info(marker: Marker, message: Message): Unit

    Annotations
    @macroImpl( ... )
  69. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  70. def logMessage(level: Level, marker: Marker, message: AnyRef, cause: Throwable): Unit

    Always logs a message at the specified level.

    Always logs a message at the specified level. It is the responsibility of the caller to ensure the specified level is enabled.

    Should normally not be used directly from application code, but needs to be public for access by macros.

    level

    log level

    marker

    marker or null

    message

    message

    cause

    cause or null

  71. def logMessage(level: Level, marker: Marker, message: CharSequence, cause: Throwable): Unit

    Always logs a message at the specified level.

    Always logs a message at the specified level. It is the responsibility of the caller to ensure the specified level is enabled.

    Should normally not be used directly from application code, but needs to be public for access by macros.

    level

    log level

    marker

    marker or null

    message

    message

    cause

    cause or null

  72. def logMessage(level: Level, marker: Marker, message: Message, cause: Throwable): Unit

    Always logs a message at the specified level.

    Always logs a message at the specified level. It is the responsibility of the caller to ensure the specified level is enabled.

    Should normally not be used directly from application code, but needs to be public for access by macros.

    level

    log level

    marker

    marker or null

    message

    message

    cause

    cause or null

  73. def throwing[T <: Throwable](level: Level, t: T): T

    Logs an exception or error to be thrown to a specific logging level.

    Logs an exception or error to be thrown to a specific logging level.

    throw logger.throwing(Level.DEBUG, myException)
    level

    the logging Level.

    t

    the Throwable

    returns

    t

    Annotations
    @macroImpl( ... )
  74. def throwing[T <: Throwable](t: T): T

    Logs an exception or error to be thrown.

    Logs an exception or error to be thrown.

    throw logger.throwing(myException)
    t

    the Throwable

    returns

    t

    Annotations
    @macroImpl( ... )
  75. def toString(): String

    Definition Classes
    Any
  76. def trace(message: AnyRef, cause: Throwable): Unit

    Annotations
    @macroImpl( ... )
  77. def trace(message: CharSequence, cause: Throwable): Unit

    Annotations
    @macroImpl( ... )
  78. def trace(message: Message, cause: Throwable): Unit

    Annotations
    @macroImpl( ... )
  79. def trace(message: AnyRef): Unit

    Annotations
    @macroImpl( ... )
  80. def trace(message: CharSequence): Unit

    Annotations
    @macroImpl( ... )
  81. def trace(message: Message): Unit

    Annotations
    @macroImpl( ... )
  82. def trace(marker: Marker, message: AnyRef, cause: Throwable): Unit

    Annotations
    @macroImpl( ... )
  83. def trace(marker: Marker, message: CharSequence, cause: Throwable): Unit

    Annotations
    @macroImpl( ... )
  84. def trace(marker: Marker, message: Message, cause: Throwable): Unit

    Annotations
    @macroImpl( ... )
  85. def trace(marker: Marker, message: AnyRef): Unit

    Annotations
    @macroImpl( ... )
  86. def trace(marker: Marker, message: CharSequence): Unit

    Annotations
    @macroImpl( ... )
  87. def trace(marker: Marker, message: Message): Unit

    Annotations
    @macroImpl( ... )
  88. def traceEntry(message: Message): EntryMessage

    Logs entry to a method using a Message to describe the parameters.

    Logs entry to a method using a Message to describe the parameters.

    def doSomething(foo: Request): Unit = {
    logger.traceEntry(JsonMessage(foo))
    // do something
    }
    message

    the message

    returns

    The built EntryMessage

    Annotations
    @macroImpl( ... )
  89. def traceEntry(params: AnyRef*): EntryMessage

    Logs entry to a method along with its parameters.

    Logs entry to a method along with its parameters.

    def doSomething(foo: String, bar: Int): Unit = {
    logger.traceEntry(foo, bar)
    // do something
    }
    params

    the parameters to the method.

    returns

    The built EntryMessage

    Annotations
    @macroImpl( ... )
  90. def traceEntry(): EntryMessage

    Logs entry to a method.

    Logs entry to a method. Used when the method in question has no parameters or when the parameters should not be logged.

    returns

    The built EntryMessage

    Annotations
    @macroImpl( ... )
  91. def traceExit[R](message: Message, result: R): R

    Logs exiting from a method with result.

    Logs exiting from a method with result. Allows custom formatting of the result.

    message

    the Message containing the formatted result

    result

    The result being returned from the method call.

    returns

    result

    Annotations
    @macroImpl( ... )
  92. def traceExit[R](entryMessage: EntryMessage, result: R): R

    Logs exiting from a method with result.

    Logs exiting from a method with result.

    def doSomething(foo: String, bar: Int): Int = {
    val entryMessage = logger.traceEntry(foo, bar)
    // do something
    traceExit(entryMessage, value)
    }
    entryMessage

    the EntryMessage returned from one of the traceEntry methods

    result

    The result being returned from the method call

    returns

    result

    Annotations
    @macroImpl( ... )
  93. def traceExit(entryMessage: EntryMessage): Unit

    Logs exiting from a method with no result.

    Logs exiting from a method with no result.

    entryMessage

    the EntryMessage returned from one of the traceEntry methods

    Annotations
    @macroImpl( ... )
  94. def traceExit[R](result: R): R

    Logs exiting from a method with result.

    Logs exiting from a method with result.

    result

    The result being returned from the method call

    returns

    result

    Annotations
    @macroImpl( ... )
  95. def traceExit(): Unit

    Logs exit from a method with no result.

    Logs exit from a method with no result.

    Annotations
    @macroImpl( ... )
  96. def warn(message: AnyRef, cause: Throwable): Unit

    Annotations
    @macroImpl( ... )
  97. def warn(message: CharSequence, cause: Throwable): Unit

    Annotations
    @macroImpl( ... )
  98. def warn(message: Message, cause: Throwable): Unit

    Annotations
    @macroImpl( ... )
  99. def warn(message: AnyRef): Unit

    Annotations
    @macroImpl( ... )
  100. def warn(message: CharSequence): Unit

    Annotations
    @macroImpl( ... )
  101. def warn(message: Message): Unit

    Annotations
    @macroImpl( ... )
  102. def warn(marker: Marker, message: AnyRef, cause: Throwable): Unit

    Annotations
    @macroImpl( ... )
  103. def warn(marker: Marker, message: CharSequence, cause: Throwable): Unit

    Annotations
    @macroImpl( ... )
  104. def warn(marker: Marker, message: Message, cause: Throwable): Unit

    Annotations
    @macroImpl( ... )
  105. def warn(marker: Marker, message: AnyRef): Unit

    Annotations
    @macroImpl( ... )
  106. def warn(marker: Marker, message: CharSequence): Unit

    Annotations
    @macroImpl( ... )
  107. def warn(marker: Marker, message: Message): Unit

    Annotations
    @macroImpl( ... )

Inherited from AnyVal

Inherited from NotNull

Inherited from Any

Ungrouped