BEA Systems, Inc.

WebLogic Server 6.1 API Reference

weblogic.management.configuration
Interface LogMBean


public interface LogMBean
extends ConfigurationMBean

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

Field Summary
static long CACHING_STUB_SVUID
           
static java.lang.String DEFAULT_FILE_NAME
          The default name of the file is based on the name of the parent of this this MBean.
static int MAX_ROTATED_FILES
           
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.
 
Method Summary
 int getFileCount()
           
 int getFileMinSize()
          Returns the minimum size (in kilobytes) that the error log file must reach before it is rolled over.
 java.lang.String getFileName()
          Returns the pathname of the error log file.
 int getFileTimeSpan()
          Timespan (in hours) after which logfile should be rotated.
 java.lang.String getRotationTime()
          Defines the date when the first rotation of the log file will begin.
 java.lang.String getRotationType()
          Return rotation type for this logfile.
 boolean isNumberOfFilesLimited()
           
 void setFileCount(int numberOfFiles)
          This attribute defines the number of file instances which are kept by the logging system, other than the current logfile.
 void setFileMinSize(int kBytes)
           
 void setFileName(java.lang.String fileName)
          Specifies name of the error log file.
 void setFileTimeSpan(int hours)
           
 void setNumberOfFilesLimited(boolean value)
          This value is relevant only when rotation is on.
 void setRotationTime(java.lang.String when)
           
 void setRotationType(java.lang.String rotationType)
          Set rotation type for this logfile.
 
Methods inherited from interface weblogic.management.configuration.ConfigurationMBean
getNotes, 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, preDeregister, preRegister
 
Methods inherited from interface javax.management.NotificationBroadcaster
addNotificationListener, getNotificationInfo, removeNotificationListener
 

Field Detail

CACHING_STUB_SVUID

public static final long CACHING_STUB_SVUID

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 name of the file is based on the name of the parent of this this MBean. For example, for server log it is "serverName".log . The name defined below is used only if name of the parent cannot be obtained for some reason.

MAX_ROTATED_FILES

public static final int MAX_ROTATED_FILES
Method Detail

getFileName

public java.lang.String getFileName()
Returns the pathname of the error log file. Relative pathnames are relative to the server's root directory.

Each server/client has one and only one logfile on the machine it is running. This file contains all error messages generated by the server/ client and application code running within it. User can configure the system such that the logfile is rotated based on size or time.

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
Specifies name of the error log file. If you specify a relative pathname, it is relative the server's root directory.

Each server/client has one and only one logfile on the machine it is running. This file contains all error messages generated by the server/ client and application code running within it. User can configure the system such that the logfile is rotated based on size or time. By default, file rotation is disabled.

File Names:

The current logfile is always the one whose name equals value of the this attribute. When the current file exceeds the size or time limit, it is renamed.

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.

Also, if 'NumberOfFilesLimited' is 'true' and curent number of old files exceed 'FileCount' the oldest file is deleted. Hence, at any time the number rotated logfiles equals the value of 'FileCount'.

See Also:
MachineMBean

getRotationType

public java.lang.String getRotationType()
Return rotation type for this logfile.

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

setRotationType

public void setRotationType(java.lang.String rotationType)
                     throws javax.management.InvalidAttributeValueException
Set rotation type for this logfile.

Default Value: NONE
Legal Values: SIZE,TIME,NONE
Parameters:
rotationType - SIZE, TIME or NONE.

setNumberOfFilesLimited

public void setNumberOfFilesLimited(boolean value)
                             throws javax.management.InvalidAttributeValueException,
                                    DistributedManagementException
This value is relevant only when rotation is on. If the value provided is 'false', the server creates new logfiles indefinitely. In this case it is the administrators responsibility to clean up files as required. Otherwise, the value of 'FileCount' is used.

A dynamic MBean attribute

isNumberOfFilesLimited

public boolean isNumberOfFilesLimited()

Default Value: false

getFileCount

public int getFileCount()

Default Value: 7

setFileCount

public void setFileCount(int numberOfFiles)
                  throws javax.management.InvalidAttributeValueException,
                         DistributedManagementException
This attribute defines the number of file instances which are kept by the logging system, other than the current logfile. This value is ignored, if the value of 'NumberOfFilesLimited' is 'false'.

A dynamic MBean attribute
Legal Value: (value <= weblogic.management.configuration.LogMBean.MAX_ROTATED_FILES && value > 0 )

getFileTimeSpan

public int getFileTimeSpan()
Timespan (in hours) after which logfile should be rotated.

Default Value: 24

getRotationTime

public java.lang.String getRotationTime()
Defines the date when the first rotation of the log file will begin. Dates are parsed using java.text.SimpleDateFormat. The following patterns are supported: k:mm For example: 23:30 to rotate every evening at 11:30PM See the javadocs for more details. Note: If the date has already past, then the DAY_OF_WEEK, HOUR_OF_DAY, MINUTE and SECOND are used with the current date to recalculate. Only valid with time based rotation. See: setRotationType(). By default, the rotation cycle begins on the first minute of each day (12:01 AM), but you can configure the rotation cycle to start on a specific day of the week or on a specific date. .

A dynamic MBean attribute
A configurable MBean attribute
Default Value: 00:00

setRotationTime

public void setRotationTime(java.lang.String when)
                     throws javax.management.InvalidAttributeValueException


setFileTimeSpan

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

A dynamic MBean attribute
Legal Minimum Value: 1

getFileMinSize

public int getFileMinSize()
Returns the minimum size (in kilobytes) that the error log file must reach before it is rolled over.

A configurable MBean attribute
Default Value: 500
Old Property: weblogic.system.maxLogFileSize

setFileMinSize

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

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/docs61

WebLogic classes and methods that do not appear in this reference are not public and are not supported.