BEA Systems, Inc.


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.


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.
static java.lang.String TIME_FORMAT
          The format string for the rotation start 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
addLinkMbeanAttribute, getNotes, isPersistenceEnabled, setNotes
 
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, preDeregister, 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.

TIME_FORMAT

public static final java.lang.String TIME_FORMAT
The format string for the rotation start time.

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. A relative pathname is relative to the server's root directory.

A configurable MBean attribute
Default Value: DEFAULT_FILE_NAME
Old Property: weblogic.system.logFile

setFileName

public void setFileName(java.lang.String fileName)
                 throws javax.management.InvalidAttributeValueException
The name of the file that stores current log messages. 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 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.log.

If you do not include a time and date stamp, the rotated log files are numbered in order of creation. For example, myserver.log0007.

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
Secure Value:  TIME
Parameters:
rotationType - SIZE, TIME or NONE.

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 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. 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
Secure Value:  false

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

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

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 <= weblogic.management.configuration.LogMBean.MAX_ROTATED_FILES && value > 0 )

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

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
Legal Value: weblogic.management.configuration.LoggingLegalHelper.isLogStartTimeValid(weblogic.management.configuration.LogMBean.TIME_FORMAT, value)

setRotationTime

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


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

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

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

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

Copyright © 2004 BEA Systems, Inc. All Rights Reserved.
WebLogic Server 7.0 API Reference