Class LoggingConfigurator


  • public class LoggingConfigurator
    extends Object
    Utility class for manipulating log4j.xml file
    Author:
    Michael Scholz, Marco Meschieri
    • Constructor Detail

      • LoggingConfigurator

        public LoggingConfigurator()
    • Method Detail

      • getLoggingFiles

        public Collection<String> getLoggingFiles()
        This method selects all file appenders
        Returns:
        collection of the appender names
      • getWebLoggingFiles

        public Collection<String> getWebLoggingFiles()
        This method selects all file appenders suitable for web visualization
        Returns:
        collection of the appender names
      • getFile

        public String getFile​(String appender,
                              boolean replaceVariables)
        This method selects a filepath of an appender.
        Parameters:
        appender - The appender name
        replaceVariables - If true all variables(${var}) in the file path will be substituted
        Returns:
        The log file path
      • setFile

        public void setFile​(String appender,
                            String file)
        This method sets a file of an appender.
        Parameters:
        appender - name of the appender
        file - path of the log file
      • addTextAppender

        public void addTextAppender​(String name)
      • addHtmlAppender

        public void addHtmlAppender​(String name)
      • addCategory

        public void addCategory​(Class clazz,
                                String[] appenders)
      • addCategory

        public void addCategory​(String name,
                                String[] appenders)
      • setLogsRoot

        public void setLogsRoot​(String rootPath)
        Sets a common path for all file appenders.
        Parameters:
        rootPath - The path to be used
      • write

        public boolean write()