public class LogConfigurationTask
extends org.apache.tools.ant.Task
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.
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
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
IBM copyright notice field.
|
Constructor and Description |
---|
LogConfigurationTask()
This is the default constructor for this class.
|
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.
|
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, init, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
public static final java.lang.String COPYRIGHT
public LogConfigurationTask()
public void execute() throws org.apache.tools.ant.BuildException
EC
log and trace configuration.execute
in class org.apache.tools.ant.Task
org.apache.tools.ant.BuildException
- This is thrown if there is an error when configuring logging and trace.Task.execute()
public java.lang.String getConfigurationFile()
public java.lang.String getFileDateStamped()
true
if a date stamp is required.public java.lang.String getLogFile()
public java.lang.String getLogFileSize()
public java.lang.String getLogSeverity()
public java.lang.String getNotificationClassName()
public java.lang.String getNotificationEnabled()
true
if notification is enabled.public java.lang.String getTraceComponents()
public java.lang.String getTraceFile()
public java.lang.String getTraceFileSize()
public void setConfigurationFile(java.lang.String configurationFile)
configurationFile
- This is the name configuration file.public void setFileDateStamped(java.lang.String fileDateStamped)
fileDateStamped
- This is a boolean
value; true
if the date should be
appended and false
otherwise.public void setLogFile(java.lang.String logFile)
logFile
- This is the name of the log file.public void setLogFileSize(java.lang.String fileSize)
fileSize
- This is the maxiumum log file size.public void setLogSeverity(java.lang.String logSeverity)
logSeverity
- This is the log severity. This is a comma separated list
that contains all the log severities to record.public void setNotificationClassName(java.lang.String notificationClassName)
notificationClassName
- This is the notification class name.public void setNotificationEnabled(java.lang.String enabled)
enabled
- This is a boolean
value; true
if notification is enabled and
false
otherwise.public void setTraceComponents(java.lang.String traceComponents)
traceComponents
- This is an object that represents the tracing components. This is a comma
separated list that contains all the tracing components to enable.public void setTraceFile(java.lang.String traceFile)
traceFile
- This is the trace file name.public void setTraceFileSize(java.lang.String traceFileSize)
traceFileSize
- This is the maximum trace file size.