com.ibm.commerce.ras.ant.tasks

Class LogConfigurationTask

  • java.lang.Object
    • org.apache.tools.ant.ProjectComponent
      • org.apache.tools.ant.Task
        • com.ibm.commerce.ras.ant.tasks.LogConfigurationTask


  • public class LogConfigurationTask
    extends org.apache.tools.ant.Task
    This class defines an ANT task to configure the EC log and trace when executing ANT tasks that make use of this facility. Since running multiple ANT tasks can share the same JVM instance, executing this task command allows the configuration to be dynamically changed.

    The log configuration ANT task takes the following parameters:

    • configurationFile: This is the file that contains the LogSystem XML configuration node that is used to initialize the logging and tracing environment.
    or
    • fileDateStamped: This indicates whether the date should be appended when the file is opened for writing. By default the value is false. Only when the file size exceeds the maximum file size will the file be renamed with the date appended.
    • logFile: This is the location of the log file that will contain the logs. If one is not specified then the log information will be written to the standard output.
    • logFileSize: This is the maximum size in megabytes of the log file.
    • logSeverity: This is the log severity to capture. This is a comma separated list. The possible values are ERROR, WARN, STATUS and DEBUG. By default only ERROR is enabled.
    • notificationEnabled: This indicates whether a notification should be sent when a log with the severity of ERROR occurs. A value of true will enable notification and the default is not to send a notification.
    • notificationClassName: This is the implementation class that implements the notification handler. If notification is enabled this parameter should also be specified.
    • traceFile: This is the location of the file where the trace is to be recorded. If one is not specified then the trace is written to the standard output.
    • traceFileSize: This is the maximum size in megabytes of the trace file.
    • traceComponents: This indicates the trace components that should be enabled. This is a comma separated list of all tracing components that should be enabled. Some of the possible values are CONTENT, LOADER, WCA_INFO, and WCA_DEBUG.

    The two possible ways to call the log configuration ANT task is as follows.

        
     
    or
        
     
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      IBM copyright notice field.
    • Constructor Summary

      Constructors 
      Constructor and Description
      LogConfigurationTask()
      This is the default constructor for this class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void execute()
      This method initializes the EC log and trace configuration.
      java.lang.String getConfigurationFile()
      This method gets the configuration file that contains the log system configuration.
      java.lang.String getFileDateStamped()
      This method gets whether the file should be created with a date stamp.
      java.lang.String getLogFile()
      This method gets the name of the log file.
      java.lang.String getLogFileSize()
      This method gets the maximum size of the log file.
      java.lang.String getLogSeverity()
      This method gets the log severities to record.
      java.lang.String getNotificationClassName()
      This method gets the notification class name.
      java.lang.String getNotificationEnabled()
      This method gets whether notification is enabled.
      java.lang.String getTraceComponents()
      This method gets the different tracing component to trace.
      java.lang.String getTraceFile()
      This method gets the name of the trace file.
      java.lang.String getTraceFileSize()
      This method gets the maximum size of the trace file.
      void setConfigurationFile(java.lang.String configurationFile)
      This method sets the name of the configuration file that contains the log system configuration.
      void setFileDateStamped(java.lang.String fileDateStamped)
      This method sets whether the date should be appended when the file is created.
      void setLogFile(java.lang.String logFile)
      This method sets the name of the log file.
      void setLogFileSize(java.lang.String fileSize)
      This method sets the maximum log file size.
      void setLogSeverity(java.lang.String logSeverity)
      This method sets the log severities to record.
      void setNotificationClassName(java.lang.String notificationClassName)
      This method sets the notification class name that is used to send notifications.
      void setNotificationEnabled(java.lang.String enabled)
      This method sets whether notification is enabled.
      void setTraceComponents(java.lang.String traceComponents)
      This method sets the tracing components to enable.
      void setTraceFile(java.lang.String traceFile)
      This method sets the name of the trace file.
      void setTraceFileSize(java.lang.String traceFileSize)
      This method sets the maximum size of the trace file.
      • Methods inherited from class org.apache.tools.ant.Task

        getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, init, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
      • Methods inherited from class org.apache.tools.ant.ProjectComponent

        getProject, setProject
      • Methods inherited from class java.lang.Object

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

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM copyright notice field.
        See Also:
        Constant Field Values
    • Constructor Detail

      • LogConfigurationTask

        public LogConfigurationTask()
        This is the default constructor for this class. It calls the constructor from the superclass.
    • Method Detail

      • execute

        public void execute()
                     throws org.apache.tools.ant.BuildException
        This method initializes the EC log and trace configuration.
        Overrides:
        execute in class org.apache.tools.ant.Task
        Throws:
        org.apache.tools.ant.BuildException - This is thrown if there is an error when configuring logging and trace.
        See Also:
        Task.execute()
      • getConfigurationFile

        public java.lang.String getConfigurationFile()
        This method gets the configuration file that contains the log system configuration.
        Returns:
        This method returns the configuration file.
      • getFileDateStamped

        public java.lang.String getFileDateStamped()
        This method gets whether the file should be created with a date stamp.
        Returns:
        This method returns true if a date stamp is required.
      • getLogFile

        public java.lang.String getLogFile()
        This method gets the name of the log file.
        Returns:
        This method returns the name of the log file.
      • getLogFileSize

        public java.lang.String getLogFileSize()
        This method gets the maximum size of the log file.
        Returns:
        This method returns the maximum size of the log file.
      • getLogSeverity

        public java.lang.String getLogSeverity()
        This method gets the log severities to record.
        Returns:
        This method returns the log severities. This is a comma separated list that contains all the log severities to record.
      • getNotificationClassName

        public java.lang.String getNotificationClassName()
        This method gets the notification class name.
        Returns:
        This method returns the notification class name.
      • getNotificationEnabled

        public java.lang.String getNotificationEnabled()
        This method gets whether notification is enabled.
        Returns:
        This method returns true if notification is enabled.
      • getTraceComponents

        public java.lang.String getTraceComponents()
        This method gets the different tracing component to trace.
        Returns:
        This method returns the enabled tracing components. This is a comma separated list that contains all the tracing components to enable.
      • getTraceFile

        public java.lang.String getTraceFile()
        This method gets the name of the trace file.
        Returns:
        This method returns the name of the trace file.
      • getTraceFileSize

        public java.lang.String getTraceFileSize()
        This method gets the maximum size of the trace file.
        Returns:
        This method returns the maximum size of the trace file.
      • setConfigurationFile

        public void setConfigurationFile(java.lang.String configurationFile)
        This method sets the name of the configuration file that contains the log system configuration.
        Parameters:
        configurationFile - This is the name configuration file.
      • setFileDateStamped

        public void setFileDateStamped(java.lang.String fileDateStamped)
        This method sets whether the date should be appended when the file is created.
        Parameters:
        fileDateStamped - This is a boolean value; true if the date should be appended and false otherwise.
      • setLogFile

        public void setLogFile(java.lang.String logFile)
        This method sets the name of the log file.
        Parameters:
        logFile - This is the name of the log file.
      • setLogFileSize

        public void setLogFileSize(java.lang.String fileSize)
        This method sets the maximum log file size.
        Parameters:
        fileSize - This is the maxiumum log file size.
      • setLogSeverity

        public void setLogSeverity(java.lang.String logSeverity)
        This method sets the log severities to record.
        Parameters:
        logSeverity - This is the log severity. This is a comma separated list that contains all the log severities to record.
      • setNotificationClassName

        public void setNotificationClassName(java.lang.String notificationClassName)
        This method sets the notification class name that is used to send notifications.
        Parameters:
        notificationClassName - This is the notification class name.
      • setNotificationEnabled

        public void setNotificationEnabled(java.lang.String enabled)
        This method sets whether notification is enabled.
        Parameters:
        enabled - This is a boolean value; true if notification is enabled and false otherwise.
      • setTraceComponents

        public void setTraceComponents(java.lang.String traceComponents)
        This method sets the tracing components to enable.
        Parameters:
        traceComponents - This is an object that represents the tracing components. This is a comma separated list that contains all the tracing components to enable.
      • setTraceFile

        public void setTraceFile(java.lang.String traceFile)
        This method sets the name of the trace file.
        Parameters:
        traceFile - This is the trace file name.
      • setTraceFileSize

        public void setTraceFileSize(java.lang.String traceFileSize)
        This method sets the maximum size of the trace file.
        Parameters:
        traceFileSize - This is the maximum trace file size.