Class RewriteAppender

    • Constructor Detail

      • RewriteAppender

        public RewriteAppender()
    • Method Detail

      • addAppender

        public void addAppender​(Appender newAppender)
        Add appender.
        Specified by:
        addAppender in interface AppenderAttachable
        Parameters:
        newAppender - appender to add, may not be null.
      • getAppender

        public Appender getAppender​(String name)
        Get appender by name.
        Specified by:
        getAppender in interface AppenderAttachable
        Parameters:
        name - name, may not be null.
        Returns:
        matching appender or null.
      • close

        public void close()
        Close this AsyncAppender by interrupting the dispatcher thread which will process all pending events before exiting.
        Specified by:
        close in interface Appender
      • isAttached

        public boolean isAttached​(Appender appender)
        Determines if specified appender is attached.
        Specified by:
        isAttached in interface AppenderAttachable
        Parameters:
        appender - appender.
        Returns:
        true if attached.
      • requiresLayout

        public boolean requiresLayout()
        Configurators call this method to determine if the appender requires a layout. If this method returns true, meaning that layout is required, then the configurator will configure an layout using the configuration information at its disposal. If this method returns false, meaning that a layout is not required, then layout configuration will be skipped even if there is available layout configuration information at the disposal of the configurator..

        In the rather exceptional case, where the appender implementation admits a layout but can also work without it, then the appender should return true.

        Specified by:
        requiresLayout in interface Appender
      • setRewritePolicy

        public void setRewritePolicy​(RewritePolicy rewritePolicy)
      • parseUnrecognizedElement

        public boolean parseUnrecognizedElement​(Element element,
                                                Properties props)
                                         throws Exception
        Called to inform a configured object when an unrecognized child element is encountered.
        Specified by:
        parseUnrecognizedElement in interface UnrecognizedElementHandler
        Parameters:
        element - element, may not be null.
        props - properties in force, may be null.
        Returns:
        true if configured object recognized the element
        Throws:
        Exception - throw an exception to prevent activation of the configured object.