Enum Class LogAppender.AppenderFlag

java.lang.Object
java.lang.Enum<LogAppender.AppenderFlag>
io.jstach.rainbowgum.LogAppender.AppenderFlag
All Implemented Interfaces:
Serializable, Comparable<LogAppender.AppenderFlag>, Constable
Enclosing interface:
LogAppender

Boolean like flags for appender that can be set with LogAppender.APPENDER_FLAGS_PROPERTY. Publisher may choose to add flags to the appenders and will be added if no flags are set on the appenders. Consequently great care should be taken when setting flags as performance maybe greatly impacted if a publisher is not designed for the flag.
  • Enum Constant Details

    • REUSE_BUFFER

      The appender will create a single buffer that will be reused and will be protected by the appenders locking.
    • IMMEDIATE_FLUSH

      The appender will call flush on each item appended or if in async batch mode for each batch.
    • REENTRY_DROP

      The appender will drop events on reentry which happens if an appender during its append causes recursive appending in the same thread. This is an analog to what Logback does by default. Note that this is done using ReentrantLock and not ThreadLocal like logback and is not done by default hence the flag!

      This flag is to allow outputs that do logging themselves. For performance reasons and to allow async publishers it is recommended that you fix the output code such that it does not do logging. This flag is ignored if REENTRY_LOG is set.

      This flag will not fix outputs causing lool like logging if an async publisher is used! That is why it is recommended you fix the output by dropping events that would cause infinite loop like logging.

      See Also:
    • REENTRY_LOG

      The appender will log events as errors to std error on reentry which happens if an appender during its append causes recursive appending in the same thread. This is an analog to what Logback does by default. Note that this is done using ReentrantLock and not ThreadLocal like logback and is not done by default hence the flag! This flag is to resolve failures of outputs that then do logging.

      This flag takes precedence over REENTRY_DROP.

  • Method Details

    • values

      public static LogAppender.AppenderFlag[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static LogAppender.AppenderFlag valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null