Class SimpleLayout

  • All Implemented Interfaces:
    OptionHandler

    public class SimpleLayout
    extends Layout
    SimpleLayout consists of the level of the log statement, followed by " - " and then the log message itself. For example,
               DEBUG - Hello world
       

    Since:
    version 0.7.0

    PatternLayout offers a much more powerful alternative.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) java.lang.StringBuffer sbuf  
    • Constructor Summary

      Constructors 
      Constructor Description
      SimpleLayout()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void activateOptions()
      Activate the options that were previously set with calls to option setters.
      java.lang.String format​(LoggingEvent event)
      Returns the log statement in a format consisting of the level, followed by " - " and then the message.
      boolean ignoresThrowable()
      The SimpleLayout does not handle the throwable contained within LoggingEvents.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • sbuf

        java.lang.StringBuffer sbuf
    • Constructor Detail

      • SimpleLayout

        public SimpleLayout()
    • Method Detail

      • activateOptions

        public void activateOptions()
        Description copied from interface: OptionHandler
        Activate the options that were previously set with calls to option setters.

        This allows to defer activiation of the options until all options have been set. This is required for components which have related options that remain ambigous until all are set.

        For example, the FileAppender has the File and Append options both of which are ambigous until the other is also set.

      • format

        public java.lang.String format​(LoggingEvent event)
        Returns the log statement in a format consisting of the level, followed by " - " and then the message. For example,
         INFO - "A message"
             

        The category parameter is ignored.

        Specified by:
        format in class Layout
        Returns:
        A byte array in SimpleLayout format.
      • ignoresThrowable

        public boolean ignoresThrowable()
        The SimpleLayout does not handle the throwable contained within LoggingEvents. Thus, it returns true.
        Specified by:
        ignoresThrowable in class Layout
        Since:
        version 0.8.4