ConfigurationMBean
, DescriptorBean
, javax.management.DynamicMBean
, javax.management.MBeanRegistration
, javax.management.NotificationBroadcaster
, SettableBean
, WebLogicMBean
CommonLogMBean
, DataSourceLogFileMBean
, JMSMessageLogFileMBean
, JMSSAFMessageLogFileMBean
, LogMBean
, WebServerLogMBean
public interface LogFileMBean extends ConfigurationMBean
Modifier and Type | Field | Description |
---|---|---|
static java.lang.String |
DEFAULT_FILE_NAME |
The default value for the log file name.
|
static int |
MAX_ROTATED_FILES |
The maximum number that you can specify for
FileCount . |
static java.lang.String |
NONE |
No log file rotation.
|
static java.lang.String |
SIZE |
Rotation based on file size.
|
static java.lang.String |
SIZE_OR_TIME |
Rotation based on either file size or time.
|
static java.lang.String |
TIME |
Rotation based on elapsed time.
|
static java.lang.String |
TIME_FORMAT |
The format string for the rotation start time.
|
DEFAULT_EMPTY_BYTE_ARRAY
Modifier and Type | Method | Description |
---|---|---|
int |
getBufferSizeKB() |
Gets the underlying log buffer size in kilobytes
|
java.lang.String |
getDateFormatPattern() |
The date format pattern used for rendering dates in the log.
|
int |
getFileCount() |
The maximum number of log files that the server creates when it
rotates the log.
|
int |
getFileMinSize() |
The size (1 - 2097150 kilobytes) that triggers the server to move log
messages to a separate file.
|
java.lang.String |
getFileName() |
The name of the file that stores current log messages.
|
int |
getFileTimeSpan() |
The interval (in hours) at which the server saves old log
messages to another file.
|
java.lang.String |
getLogFileRotationDir() |
The directory where the rotated log files will be stored.
|
boolean |
getRotateLogOnStartup() |
Specifies whether a server rotates its log file during its
startup cycle.
|
java.lang.String |
getRotationTime() |
Determines the start time (hour and minute) for a time-based rotation sequence.
|
java.lang.String |
getRotationType() |
Criteria for moving old log messages to a separate file.
|
boolean |
isNumberOfFilesLimited() |
Indicates whether to limit the number of log files that this server
instance creates to store old messages.
|
void |
setBufferSizeKB(int size) |
Sets the underlying log buffer size in kilobytes
|
void |
setDateFormatPattern(java.lang.String dateFormat) |
|
void |
setFileCount(int numberOfFiles) |
Sets the value of the FileCount attribute.
|
void |
setFileMinSize(int kBytes) |
Sets the value of the FileMinSize attribute.
|
void |
setFileName(java.lang.String fileName) |
Sets the name of the file that stores current log messages.
|
void |
setFileTimeSpan(int hours) |
Sets the value of the FileTimeSpan attribute.
|
void |
setFileTimeSpanFactor(long factor) |
|
void |
setLogFileRotationDir(java.lang.String dirPath) |
Sets the value of the LogFileRotationDir attribute.
|
void |
setNumberOfFilesLimited(boolean value) |
Sets the value of the NumberOfFilesLimited attribute.
|
void |
setRotateLogOnStartup(boolean value) |
Sets the value of the RotateLogOnStartup attribute.
|
void |
setRotationTime(java.lang.String when) |
Sets the value of the RotationTime attribute.
|
void |
setRotationType(java.lang.String rotationType) |
Sets the value of the RotationType attribute.
|
freezeCurrentValue, getId, getInheritedProperties, getName, getNotes, isDynamicallyCreated, isInherited, isSet, restoreDefaultValue, setComments, setDefaultedMBean, setName, setNotes, setPersistenceEnabled, unSet
addPropertyChangeListener, createChildCopyIncludingObsolete, getParentBean, isEditable, removePropertyChangeListener
getAttribute, getAttributes, invoke, setAttribute, setAttributes
postDeregister, postRegister, preDeregister, preRegister
addNotificationListener, getNotificationInfo, removeNotificationListener
getMBeanInfo, getObjectName, getParent, getType, isCachingDisabled, isRegistered, setParent
static final java.lang.String SIZE_OR_TIME
static final java.lang.String SIZE
static final java.lang.String TIME
static final java.lang.String NONE
static final java.lang.String TIME_FORMAT
static final java.lang.String DEFAULT_FILE_NAME
The default value for the log file name.
static final int MAX_ROTATED_FILES
FileCount
.java.lang.String getDateFormatPattern()
The date format pattern used for rendering dates in the log.
The DateFormatPattern string conforms to
the specification of the java.text.SimpleDateFormat
class.
void setDateFormatPattern(java.lang.String dateFormat)
java.lang.String getFileName()
The name of the file that stores current log messages. Usually it is a
computed value based on the name of the parent of this MBean. For example,
for a server log, it is SERVER_NAME.log
.
However, if the name of the parent cannot be obtained,
the file name is weblogic.log
. If you
specify a relative pathname, it is interpreted as relative to the
server's root directory.
To include a time and date stamp in the file name when the log
file is rotated, add java.text.SimpleDateFormat
variables to the file name. Surround each variable with percentage
(%
) characters.
For example, if the file name is defined to be
myserver_%yyyy%_%MM%_%dd%_%hh%_%mm%.log
, the log file
will be named myserver_yyyy_mm_dd_hh_mm.log
.
When the log file is rotated, the rotated file name contains the
date stamp. For example, if the log file is rotated for the first time on 2 April,
2003 at 10:05 AM, the log file that contains the old messages will
be named myserver_2003_04_02_10_05.log00001
.
If you do not include a time and date stamp, the rotated log
files are numbered in order of creation. For example,
myserver.log00007
.
void setFileName(java.lang.String fileName) throws javax.management.InvalidAttributeValueException
Sets the name of the file that stores current log messages.
fileName
- The new fileName valuejavax.management.InvalidAttributeValueException
getFileName()
,
MachineMBean
java.lang.String getRotationType()
Criteria for moving old log messages to a separate file.
NONE
Messages accumulate in a single file.
You must erase the contents of the file when the size is too large.
Note that WebLogic Server sets a threshold size limit of 500 MB
before it forces a hard rotation to prevent excessive log file growth.SIZE
When the log file reaches the size that you specify
in FileMinSize
, the server renames the file as
SERVER_NAME.lognnnnn
.TIME
At each time interval that you specify in
TimeSpan
, the server renames the file as SERVER_NAME.lognnnnn
.After the server renames a file, subsequent messages accumulate in a new file with the name that you specified as the log file name.
void setRotationType(java.lang.String rotationType) throws javax.management.InvalidAttributeValueException
Sets the value of the RotationType attribute.
rotationType
- SIZE, TIME or NONE.javax.management.InvalidAttributeValueException
getRotationType()
void setNumberOfFilesLimited(boolean value) throws javax.management.InvalidAttributeValueException, DistributedManagementException
Sets the value of the NumberOfFilesLimited attribute.
value
- The new numberOfFilesLimited valuejavax.management.InvalidAttributeValueException
DistributedManagementException
isNumberOfFilesLimited()
boolean isNumberOfFilesLimited()
Indicates whether to limit the number of log files that this server
instance creates to store old messages. (Requires that you
specify a file rotation type of SIZE
or
TIME
.)
After the server reaches this limit, it deletes the oldest log file and creates a new log file with the latest suffix.
If you do not enable this option, the server creates new files indefinitely and you must clean up these files as you require.
getRotationType()
int getFileCount()
The maximum number of log files that the server creates when it rotates the log. This number does not include the file that the server uses to store current messages. (Requires that you enable Number of Files Limited.)
isNumberOfFilesLimited()
void setFileCount(int numberOfFiles) throws javax.management.InvalidAttributeValueException, DistributedManagementException
Sets the value of the FileCount attribute.
numberOfFiles
- The new fileCount valuejavax.management.InvalidAttributeValueException
DistributedManagementException
getFileCount()
int getFileTimeSpan()
The interval (in hours) at which the server saves old log
messages to another file. (Requires that you specify a file
rotation type of TIME
.)
getRotationType()
java.lang.String getRotationTime()
Determines the start time (hour and minute) for a time-based rotation sequence.
At the time that this value specifies, the server renames the current log file. Thereafter, the server renames the log file at an interval that you specify in File Time Span.
Note that WebLogic Server sets a threshold size limit of 500 MB before it forces a hard rotation to prevent excessive log file growth.
Use the following format: H:mm
, where
H
is Hour in day (0-23)mm
is the minute in hourgetRotationType()
,
getFileTimeSpan()
void setRotationTime(java.lang.String when) throws javax.management.InvalidAttributeValueException
Sets the value of the RotationTime attribute.
when
- The new rotationTime valuejavax.management.InvalidAttributeValueException
getRotationTime()
void setFileTimeSpan(int hours) throws javax.management.InvalidAttributeValueException, DistributedManagementException
Sets the value of the FileTimeSpan attribute.
hours
- The new fileTimeSpan valuejavax.management.InvalidAttributeValueException
DistributedManagementException
getFileTimeSpan()
void setFileTimeSpanFactor(long factor)
int getFileMinSize()
SERVER_NAME.lognnnnn
and create
a new one to store subsequent messages. (Requires that you specify a
file rotation type of Size
.)getRotationType()
void setFileMinSize(int kBytes) throws javax.management.InvalidAttributeValueException, DistributedManagementException
Sets the value of the FileMinSize attribute.
kBytes
- The new fileMinSize valuejavax.management.InvalidAttributeValueException
DistributedManagementException
getFileMinSize()
boolean getRotateLogOnStartup()
Specifies whether a server rotates its log file during its startup cycle. The default value in production mode is false.
void setRotateLogOnStartup(boolean value)
Sets the value of the RotateLogOnStartup attribute.
java.lang.String getLogFileRotationDir()
The directory where the rotated log files will be stored. By default the rotated files are stored in the same directory where the log file is stored.
void setLogFileRotationDir(java.lang.String dirPath)
Sets the value of the LogFileRotationDir attribute.
getLogFileRotationDir()
int getBufferSizeKB()
void setBufferSizeKB(int size)