Class SingleLinePatternLayout

  • All Implemented Interfaces:
    ch.qos.logback.core.Layout<ch.qos.logback.classic.spi.ILoggingEvent>, ch.qos.logback.core.spi.ContextAware, ch.qos.logback.core.spi.LifeCycle

    public class SingleLinePatternLayout
    extends ch.qos.logback.classic.PatternLayout
    Custom PatternLayout for logging entries.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static int BUFFER_PER_LINE
      Average buffer size per line of stack trace.
      private static String LINE_SEP
      The separator used as replacement for newlines.
      private static Pattern LINEBREAK_PATTERN
      Regular expression for line breaks.
      private static String NEWLINE
      OS specific line separator.
      • Fields inherited from class ch.qos.logback.classic.PatternLayout

        defaultConverterMap, HEADER_PREFIX
      • Fields inherited from class ch.qos.logback.core.pattern.PatternLayoutBase

        outputPatternAsHeader, postCompileProcessor
      • Fields inherited from class ch.qos.logback.core.LayoutBase

        started
      • Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase

        context
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      String doLayout​(ch.qos.logback.classic.spi.ILoggingEvent event)
      Creates formatted String, using conversion pattern.
      private String preventLogForging​(String logMsg)
      Method to prevent log forging.
      • Methods inherited from class ch.qos.logback.classic.PatternLayout

        getDefaultConverterMap, getPresentationHeaderPrefix
      • Methods inherited from class ch.qos.logback.core.pattern.PatternLayoutBase

        getEffectiveConverterMap, getInstanceConverterMap, getPattern, getPresentationHeader, isOutputPatternAsHeader, setContextForConverters, setOutputPatternAsHeader, setPattern, setPostCompileProcessor, start, toString, writeLoopOnConverters
      • Methods inherited from class ch.qos.logback.core.LayoutBase

        getContentType, getContext, getFileFooter, getFileHeader, getPresentationFooter, isStarted, setContext, setFileFooter, setFileHeader, setPresentationFooter, setPresentationHeader, stop
      • Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase

        addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getDeclaredOrigin, getStatusManager
      • Methods inherited from interface ch.qos.logback.core.spi.ContextAware

        addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn
    • Field Detail

      • NEWLINE

        private static final String NEWLINE
        OS specific line separator.
      • LINEBREAK_PATTERN

        private static final Pattern LINEBREAK_PATTERN
        Regular expression for line breaks.
      • BUFFER_PER_LINE

        private static final int BUFFER_PER_LINE
        Average buffer size per line of stack trace.
        See Also:
        Constant Field Values
    • Constructor Detail

      • SingleLinePatternLayout

        public SingleLinePatternLayout()
        Default constructor.
    • Method Detail

      • doLayout

        public String doLayout​(ch.qos.logback.classic.spi.ILoggingEvent event)
        Creates formatted String, using conversion pattern.
        Specified by:
        doLayout in interface ch.qos.logback.core.Layout<ch.qos.logback.classic.spi.ILoggingEvent>
        Overrides:
        doLayout in class ch.qos.logback.classic.PatternLayout
        Parameters:
        event - ILoggingEvent
        Returns:
        String Formatted event as string in one line
      • preventLogForging

        private String preventLogForging​(String logMsg)
        Method to prevent log forging.
        Parameters:
        logMsg -
        Returns:
        Encoded message