Interface JsonProvider<Event extends ch.qos.logback.core.spi.DeferredProcessingAware>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean canWrite​(Event event)
      Indicates if this provider can write anything for a particular event.
      boolean isEnabled()
      Indicates if this provider is enabled.
      void setEnabled​(boolean enabled)
      Allows to configure if the provider is enabled.
      boolean writeTo​(JsonEventWriter writer, Event event, boolean startWithSeparator)
      Writes a certain aspect of event into a writer.
      • Methods inherited from interface ch.qos.logback.core.spi.ContextAware

        addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, setContext
      • Methods inherited from interface ch.qos.logback.core.spi.LifeCycle

        isStarted, start, stop
    • Method Detail

      • isEnabled

        boolean isEnabled()
        Indicates if this provider is enabled. For a disabled provider no other its methods should be called.
      • setEnabled

        void setEnabled​(boolean enabled)
        Allows to configure if the provider is enabled.
      • canWrite

        boolean canWrite​(Event event)
        Indicates if this provider can write anything for a particular event. If this method returns false, writeTo() should not be called for a particular event. You can put all your preliminary checks here, no need to duplicated them in writeTo().
      • writeTo

        boolean writeTo​(JsonEventWriter writer,
                        Event event,
                        boolean startWithSeparator)
        Writes a certain aspect of event into a writer.
        Parameters:
        writer - JSON writer to use.
        event - Current logback event.
        startWithSeparator - If true, a separator should be written before writing anything else.
        Returns:
        If anything was effectively written during this call.