Class AbstractJsonLayoutBaseFactory<E extends ch.qos.logback.core.spi.DeferredProcessingAware>

java.lang.Object
io.dropwizard.logging.json.AbstractJsonLayoutBaseFactory<E>
All Implemented Interfaces:
Discoverable, DiscoverableLayoutFactory<E>
Direct Known Subclasses:
AccessJsonLayoutBaseFactory, EventJsonLayoutBaseFactory

public abstract class AbstractJsonLayoutBaseFactory<E extends ch.qos.logback.core.spi.DeferredProcessingAware> extends Object implements DiscoverableLayoutFactory<E>
Name Default Description
timestampFormat (none) By default, the timestamp is not formatted; To format the timestamp using set the property with the corresponding DateTimeFormatter string, for example, yyyy-MM-ddTHH:mm:ss.SSSZ
prettyPrint false Whether the JSON output should be formatted for human readability.
appendLineSeparator true Whether to append a line separator at the end of the message formatted as JSON.
customFieldNames empty A map of field name replacements. For example: (requestTime:request_time, userAgent:user_agent)
additionalFields empty A map of fields to add.
  • Constructor Details

    • AbstractJsonLayoutBaseFactory

      public AbstractJsonLayoutBaseFactory()
  • Method Details

    • getTimestampFormat

      public @Nullable String getTimestampFormat()
    • setTimestampFormat

      public void setTimestampFormat(String timestampFormat)
    • isPrettyPrint

      public boolean isPrettyPrint()
    • setPrettyPrint

      public void setPrettyPrint(boolean prettyPrint)
    • isAppendLineSeparator

      public boolean isAppendLineSeparator()
    • setAppendLineSeparator

      public void setAppendLineSeparator(boolean appendLineSeparator)
    • getCustomFieldNames

      public Map<String,String> getCustomFieldNames()
    • setCustomFieldNames

      public void setCustomFieldNames(Map<String,String> customFieldNames)
    • getAdditionalFields

      public Map<String,Object> getAdditionalFields()
    • setAdditionalFields

      public void setAdditionalFields(Map<String,Object> additionalFields)
    • createDropwizardJsonFormatter

      protected JsonFormatter createDropwizardJsonFormatter()
    • createTimestampFormatter

      protected TimestampFormatter createTimestampFormatter(TimeZone timeZone)