Class AuthenticatedUserConverter

java.lang.Object
ch.qos.logback.core.pattern.Converter<E>
ch.qos.logback.core.pattern.FormattingConverter<E>
ch.qos.logback.core.pattern.DynamicConverter<Object>
com.flowable.platform.common.logging.logback.AuthenticatedUserConverter
All Implemented Interfaces:
ch.qos.logback.core.spi.ContextAware, ch.qos.logback.core.spi.LifeCycle

public class AuthenticatedUserConverter extends ch.qos.logback.core.pattern.DynamicConverter<Object>
A Logback converter that can be used to output the currently authenticated user. It can be registered by using the following in your logback.xml file.

 <configuration>

   <conversionRule conversionWord="authenticatedUser"
                   converterClass="com.flowable.platform.common.logging.logback.AuthenticatedUserConverter" />
    ...
 </configuration>
 
More about this can be read in the Logback custom conversion specifier documentation. It can then be used with %authenticatedUser in the log pattern.

When there is no user then <missing> will be used.

Author:
Filip Hrisafov
  • Field Summary

    Fields inherited from class ch.qos.logback.core.pattern.DynamicConverter

    started
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    convert(Object event)
     

    Methods inherited from class ch.qos.logback.core.pattern.DynamicConverter

    addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getFirstOption, getOptionList, isStarted, setContext, setOptionList, start, stop

    Methods inherited from class ch.qos.logback.core.pattern.FormattingConverter

    getFormattingInfo, setFormattingInfo, write

    Methods inherited from class ch.qos.logback.core.pattern.Converter

    getNext, setNext

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AuthenticatedUserConverter

      public AuthenticatedUserConverter()
  • Method Details

    • convert

      public String convert(Object event)
      Specified by:
      convert in class ch.qos.logback.core.pattern.Converter<Object>