BEA Systems, Inc.

WebLogic Server 8.1 API Reference

weblogic.management.configuration
Interface LogMBean


public interface LogMBean
extends ConfigurationMBean

Configures the location, file-rotation criteria, and number of files that a WebLogic Server uses to store log messages. The methods in this class configure both server and domain log files.

Author:
Copyright © 2002 BEA Systems, Inc. All Rights Reserved.

Field Summary
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 logfile rotation.
static java.lang.String SIZE
          Rotation based on file size.
static java.lang.String TIME
          Rotation based on elapsed time.
 
Fields inherited from class weblogic.management.configuration.ConfigurationMBean
CACHING_STUB_SVUID
 
Method Summary
 int getFileCount()
          The maximum number of log files that the server creates when it rotates the log.
 int getFileMinSize()
          The size (1 - 65535 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 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: NONE.
 boolean isNumberOfFilesLimited()
          Indicates whether a server will limit the number of log files that it creates when it rotates the log.
 void setFileCount(int numberOfFiles)
          The maximum number of files that the server creates to store old log messages.
 void setFileMinSize(int kBytes)
          The size (1 - 65535 kilobytes) that triggers the server to move log messages to a separate file.
 void setFileName(java.lang.String fileName)
          The name of the file that stores current log messages.
 void setFileTimeSpan(int hours)
          The interval (in hours) at which the server saves old log messages to another file.
 void setNumberOfFilesLimited(boolean value)
          Limits the number of files that a server creates to store old messages to the maximum number specified in FileCount.
 void setRotationTime(java.lang.String when)
          Determines the start time for a time-based rotation sequence.
 void setRotationType(java.lang.String rotationType)
          Criteria for moving old log messages to a separate file: NONE.
 
Methods inherited from interface weblogic.management.configuration.ConfigurationMBean
freezeCurrentValue, getNotes, restoreDefaultValue, setComments, setDefaultedMBean, setNotes, setPersistenceEnabled
 
Methods inherited from interface weblogic.management.WebLogicMBean
getMBeanInfo, getName, getObjectName, getParent, getType, isCachingDisabled, isRegistered, setName, setParent
 
Methods inherited from interface javax.management.DynamicMBean
getAttribute, getAttributes, invoke, setAttribute, setAttributes
 
Methods inherited from interface javax.management.MBeanRegistration
postDeregister, postRegister, preRegister
 
Methods inherited from interface javax.management.NotificationBroadcaster
addNotificationListener, getNotificationInfo, removeNotificationListener
 

Field Detail

SIZE

public static final java.lang.String SIZE
Rotation based on file size.

TIME

public static final java.lang.String TIME
Rotation based on elapsed time.

NONE

public static final java.lang.String NONE
No logfile rotation.

DEFAULT_FILE_NAME

public static final java.lang.String DEFAULT_FILE_NAME
The default value for the log file name. Usually it is a computed value based on the name of the parent of this MBean. For example, for a server log it is serverName.log.

However, if name of the parent cannot be obtained for some reason, then the name is weblogic.log.


MAX_ROTATED_FILES

public static final int MAX_ROTATED_FILES
The maximum number that you can specify for FileCount.
Method Detail

getFileName

public java.lang.String getFileName()
The name of the file that stores current log messages. If the pathname is not absolute, the path is assumed to be relative to the server's root directory. For the domain log file, the path is relative to the root directory of the Administration Server.

If the name does not include a path element, then pathname will be computed as follows:

If neither file name nor pathname is specified, then the name is computed as follows:

If you enable the server to rotate messages across multiple files, this value is the base name for the files that store old messages: FileName.n.

A configurable MBean attribute
Default Value: DEFAULT_FILE_NAME
Old Property: weblogic.system.logFile
Returns:
The fileName value

setFileName

public void setFileName(java.lang.String fileName)
                 throws javax.management.InvalidAttributeValueException
The name of the file that stores current log messages. If the pathname is not absolute, the path is assumed to be relative to the server's root directory. For the domain log file, the path is relative to the root directory of the Administration Server.

If you enable the server to rotate messages across multiple files, this value is the base name for the files that store old messages: FileName.n.

Parameters:
fileName - The new fileName value
Throws:
javax.management.InvalidAttributeValueException - Description of the Exception
See Also:
MachineMBean

getRotationType

public java.lang.String getRotationType()
Criteria for moving old log messages to a separate file:

After the server renames a file, subsequent messages accumulate in a new file with the name that you specified in FileName.

A dynamic MBean attribute
Returns:
SIZE, TIME or NONE.

setRotationType

public void setRotationType(java.lang.String rotationType)
                     throws javax.management.InvalidAttributeValueException
Criteria for moving old log messages to a separate file:

After the server renames a file, subsequent messages accumulate in a new file with the name that you specified in FileName.

Default Value: NONE
Legal Values: SIZE,TIME,NONE
Parameters:
rotationType - SIZE, TIME or NONE.
Throws:
javax.management.InvalidAttributeValueException - Description of the Exception

setNumberOfFilesLimited

public void setNumberOfFilesLimited(boolean value)
                             throws javax.management.InvalidAttributeValueException,
                                    DistributedManagementException
Limits the number of files that a server creates to store old messages to the maximum number specified in FileCount. After the server reaches this limit, it overwrites the oldest file.

If you do not enable this option, the server creates new files indefinitely. You must clean up these files as you require.

This value is relevant only if you specify a file rotation type of SIZE or TIME.

A dynamic MBean attribute
Parameters:
value - The new numberOfFilesLimited value
Throws:
javax.management.InvalidAttributeValueException - Description of the Exception
DistributedManagementException - Description of the Exception

isNumberOfFilesLimited

public boolean isNumberOfFilesLimited()
Indicates whether a server will limit the number of log files that it creates when it rotates the log. The limit is based on getFileCount.

Default Value: false
Returns:
The numberOfFilesLimited value

getFileCount

public int getFileCount()
The maximum number of log files that the server creates when it rotates the log. Only valid if isNumberOfFilesLimited is true and setRotationType is either Size or Time.

Default Value: 7
Returns:
The fileCount value

setFileCount

public void setFileCount(int numberOfFiles)
                  throws javax.management.InvalidAttributeValueException,
                         DistributedManagementException
The maximum number of files that the server creates to store old log messages. This number does not include the file that the server uses to store current messages (the name of which you specify in FileName). This value is relevant only if you enable NumberOfFilesLimited.

A dynamic MBean attribute
Legal Value: (value <= LogMBean.MAX_ROTATED_FILES && value > 0 )
Parameters:
numberOfFiles - The new fileCount value
Throws:
javax.management.InvalidAttributeValueException - Description of the Exception
DistributedManagementException - Description of the Exception

getFileTimeSpan

public int getFileTimeSpan()
The interval (in hours) at which the server saves old log messages to another file. This value is relevant only if you use the time-based rotation type.

Default Value: 24
Returns:
The fileTimeSpan value

getRotationTime

public 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 as FileName.n. Thereafter, the server renames the log file at an interval that you specify in FileTimeSpan.

Use the following format: hh:mm, where hh is the hour in a 24-hour format and mm is the minute.

If the time that you specify has already past, then the server starts its file rotation immediately.

By default, the rotation cycle begins at 12:00 AM.

A dynamic MBean attribute
A configurable MBean attribute
Default Value: 00:00
Returns:
The rotationTime value

setRotationTime

public void setRotationTime(java.lang.String when)
                     throws javax.management.InvalidAttributeValueException
Determines the start time for a time-based rotation sequence.

Parameters:
when - The new rotationTime value
Throws:
javax.management.InvalidAttributeValueException - Description of the Exception

setFileTimeSpan

public void setFileTimeSpan(int hours)
                     throws javax.management.InvalidAttributeValueException,
                            DistributedManagementException
The interval (in hours) at which the server saves old log messages to another file. This value is relevant only you use the time-based rotation type.

A dynamic MBean attribute
Legal Minimum Value: 1
Parameters:
hours - The new fileTimeSpan value
Throws:
javax.management.InvalidAttributeValueException - Description of the Exception
DistributedManagementException - Description of the Exception

getFileMinSize

public int getFileMinSize()
The size (1 - 65535 kilobytes) that triggers the server to move log messages to a separate file. After the log file reaches the specified minimum size, the next time the server checks the file size, it will rename the current log file as FileName.n and create a new one to store subsequent messages. (This field is relevant only if you set Rotation Type to By Size.)

A configurable MBean attribute
Default Value: 500
Old Property: weblogic.system.maxLogFileSize
Returns:
The fileMinSize value

setFileMinSize

public void setFileMinSize(int kBytes)
                    throws javax.management.InvalidAttributeValueException,
                           DistributedManagementException
The size (1 - 65535 kilobytes) that triggers the server to move log messages to a separate file. After the log file reaches the specified minimum size, the next time the server checks the file size, it will rename the current log file as FileName.n and create a new one to store subsequent messages. (This field is relevant only if you set Rotation Type to By Size.)

A dynamic MBean attribute
Legal Minimum Value: 1
Legal Maximum Value: 65535
Parameters:
kBytes - The new fileMinSize value
Throws:
javax.management.InvalidAttributeValueException - Description of the Exception
DistributedManagementException - Description of the Exception

Documentation is available at
http://download.oracle.com/docs/cd/E13222_01/wls/docs81b