BEA Systems, Inc.

Type-Safe Access to BEA WebLogic Server 9.0 MBeans (Deprecated)

(Methods marked with @since 9.0.0.0 are not available through the deprecated MBeanHome interface.)


weblogic.management.configuration
Interface LogFileMBean

All Superinterfaces:
ConfigurationMBean, weblogic.descriptor.DescriptorBean, DynamicMBean, MBeanRegistration, NotificationBroadcaster, weblogic.descriptor.SettableBean, weblogic.management.WebLogicMBean
All Known Subinterfaces:
JMSMessageLogFileMBean, LogMBean, WebServerLogMBean

public interface LogFileMBean
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.

Deprecation of MBeanHome and Type-Safe Interfaces

This is a type-safe interface for a WebLogic Server MBean, which you can import into your client classes and access through weblogic.management.MBeanHome. As of 9.0, the MBeanHome interface and all type-safe interfaces for WebLogic Server MBeans are deprecated. Instead, client classes that interact with WebLogic Server MBeans should use standard JMX design patterns in which clients use the javax.management.MBeanServerConnection interface to discover MBeans, attributes, and attribute types at runtime. For more information, see "Developing Manageable Applications with JMX" on http://www.oracle.com/technology/documentation/index.html.

Copyright © 2005 BEA Systems, Inc. All Rights Reserved.

Field Summary
static 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 String NONE
          No log file rotation.
static String SIZE
          Rotation based on file size.
static String TIME
          Rotation based on elapsed time.
static String TIME_FORMAT
          The format string for the rotation start time.
 
Fields inherited from interface weblogic.management.configuration.ConfigurationMBean
DEFAULT_EMPTY_BYTE_ARRAY
 
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.
 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.
 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.
 String getRotationTime()
          Determines the start time (hour and minute) for a time-based rotation sequence.
 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 setFileCount(int numberOfFiles)
          Sets the value of the FileCount attribute.
 void setFileMinSize(int kBytes)
          Sets the value of the FileMinSize attribute.
 void setFileName(String fileName)
          Sets the value of the fileName attribute.
 void setFileTimeSpan(int hours)
          Sets the value of the FileTimeSpan attribute.
 void setFileTimeSpanFactor(long factor)
           
 void setLogFileRotationDir(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(String when)
          Sets the value of the RotationTime attribute.
 void setRotationType(String rotationType)
          Sets the value of the RotationType attribute.
 
Methods inherited from interface weblogic.management.configuration.ConfigurationMBean
freezeCurrentValue, getName, getNotes, isSet, restoreDefaultValue, setComments, setDefaultedMBean, setName, setNotes, setPersistenceEnabled, unSet
 
Methods inherited from interface weblogic.management.WebLogicMBean
getMBeanInfo, getObjectName, getParent, getType, isCachingDisabled, isRegistered, 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
 
Methods inherited from interface weblogic.descriptor.DescriptorBean
addBeanUpdateListener, addPropertyChangeListener, createChildCopy, createChildCopyIncludingObsolete, getDescriptor, getParentBean, isEditable, removeBeanUpdateListener, removePropertyChangeListener
 

Field Detail

DEFAULT_FILE_NAME

public static final String DEFAULT_FILE_NAME

The default value for the log file name.

See Also:
Constant Field Values

MAX_ROTATED_FILES

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

See Also:
Constant Field Values

NONE

public static final String NONE
No log file rotation.

See Also:
Constant Field Values

SIZE

public static final String SIZE
Rotation based on file size.

See Also:
Constant Field Values

TIME

public static final String TIME
Rotation based on elapsed time.

See Also:
Constant Field Values

TIME_FORMAT

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

See Also:
Constant Field Values
Method Detail

getFileCount

public 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.)

Returns:
The fileCount value
See Also:
isNumberOfFilesLimited()
Default value:
7

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. (Requires that you specify a file rotation type of Size.)

Returns:
The fileMinSize value
See Also:
getRotationType()
Default value:
500
A configurable MBean attribute.
Production mode default value:
5000

getFileName

public 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 serverName.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 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.log00007.

Returns:
The fileName value
A configurable MBean attribute.

getFileTimeSpan

public 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.)

Returns:
The fileTimeSpan value
See Also:
getRotationType()
Default value:
24

getLogFileRotationDir

public 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.

Returns:

getRotateLogOnStartup

public boolean getRotateLogOnStartup()

Specifies whether a server rotates its log file during its startup cycle.

Default value:
true
Production mode default value:
false

getRotationTime

public 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.

If the specified time has already past, then the server starts its file rotation immediately.

Use the following format: k:mm, where

Returns:
The rotationTime value
See Also:
getRotationType(), getFileTimeSpan()

getRotationType

public 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.

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

isNumberOfFilesLimited

public 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.

Returns:
The numberOfFilesLimited value
See Also:
getRotationType()
Default value:
false

setFileCount

public void setFileCount(int numberOfFiles)
                  throws InvalidAttributeValueException,
                         weblogic.management.DistributedManagementException

Sets the value of the FileCount attribute.

Parameters:
numberOfFiles - The new fileCount value
Throws:
InvalidAttributeValueException
weblogic.management.DistributedManagementException
See Also:
getFileCount()
Minimum value:
1
Maximum value:
LogMBean.MAX_ROTATED_FILES
A dynamic MBean attribute.

setFileMinSize

public void setFileMinSize(int kBytes)
                    throws InvalidAttributeValueException,
                           weblogic.management.DistributedManagementException

Sets the value of the FileMinSize attribute.

Parameters:
kBytes - The new fileMinSize value
Throws:
InvalidAttributeValueException
weblogic.management.DistributedManagementException
See Also:
getFileMinSize()
Minimum value:
1
Maximum value:
65535
A dynamic MBean attribute.

setFileName

public void setFileName(String fileName)
                 throws InvalidAttributeValueException

Sets the value of the fileName attribute.

Parameters:
fileName - The new fileName value
Throws:
InvalidAttributeValueException
See Also:
getFileName(), MachineMBean

setFileTimeSpan

public void setFileTimeSpan(int hours)
                     throws InvalidAttributeValueException,
                            weblogic.management.DistributedManagementException

Sets the value of the FileTimeSpan attribute.

Parameters:
hours - The new fileTimeSpan value
Throws:
InvalidAttributeValueException
weblogic.management.DistributedManagementException
See Also:
getFileTimeSpan()
Minimum value:
1
A dynamic MBean attribute.

setFileTimeSpanFactor

public void setFileTimeSpanFactor(long factor)

setLogFileRotationDir

public void setLogFileRotationDir(String dirPath)

Sets the value of the LogFileRotationDir attribute.

See Also:
getLogFileRotationDir()

setNumberOfFilesLimited

public void setNumberOfFilesLimited(boolean value)
                             throws InvalidAttributeValueException,
                                    weblogic.management.DistributedManagementException

Sets the value of the NumberOfFilesLimited attribute.

Parameters:
value - The new numberOfFilesLimited value
Throws:
InvalidAttributeValueException
weblogic.management.DistributedManagementException
See Also:
isNumberOfFilesLimited()
A dynamic MBean attribute.

setRotateLogOnStartup

public void setRotateLogOnStartup(boolean value)

Sets the value of the RotateLogOnStartup attribute.


setRotationTime

public void setRotationTime(String when)
                     throws InvalidAttributeValueException

Sets the value of the RotationTime attribute.

Parameters:
when - The new rotationTime value
Throws:
InvalidAttributeValueException
See Also:
getRotationTime()
Default value:
"00:00"
A configurable MBean attribute.
A dynamic MBean attribute.

setRotationType

public void setRotationType(String rotationType)
                     throws InvalidAttributeValueException

Sets the value of the RotationType attribute.

Parameters:
rotationType - SIZE, TIME or NONE.
Throws:
InvalidAttributeValueException
See Also:
getRotationType()
Default value:
LogFileMBean.SIZE
Legal values:
LogFileMBean.SIZE,LogFileMBean.TIME,LogFileMBean.NONE

Documentation is available at
http://download.oracle.com/docs/cd/E13222_01/wls/docs90
Copyright 2005 BEA Systems Inc.