Using WLST, you can configure a server instance’s logging and message output. To determine which log attributes can be configured, see LogMBean and LogFileMBean in the WebLogic Server MBean Reference[1].
Modifying Attribute from WLS Console
To bring WLS Administration Console up, you type the following address into your browser's address field:
- http://<myserver>:7001/console
and log in with your credentials (say, "weblogic/weblogic1"). To modify "Rotation file size" of the log attribute, you do:
- Click "Lock & Edit"
- Select and Click:
- Environment > Servers > CRMDemo_server1 > Logging
You modify "Rotation file size" to be a different value and then activate your change.
Next to the "Rotation file size" field, you can click on "More Info..." to see its detailed description.
As you can see, "Rotation file size" field is linked to the following MBean Attibute:
- LogMBean.FileMinSize
Modifying Attribute from WLST
Instead of modifying log attributes from the console, you can also achieve it by using WLST.
$cd $MW_HOME/wlserver_10.3/common/bin
$./wlst.sh
wls:/offline> connect("weblogic","weblogic1", "t3://localhost:7001")
wls:/atgdomain/serverConfig> cd("Servers/CRMDemo_server1/Log/CRMDemo_server1")
wls:/atgdomain/serverConfig/Servers/CRMDemo_server1/Log/CRMDemo_server1> ls() dr-- DomainLogBroadcastFilter dr-- LogFileFilter -r-- FileMinSize 5000 -r-- FileName logs/CRMDemo_server1.log . . . -r-x unSet Void : String(propertyName)
As shown above, this is what happened:
- We connected to the server
- We set Current Management Object (CMO) to the server log config
- We listed all LogMBean attributes
- Our log attribute FileMinSize was shown on the list
# Connect to the server connect("weblogic","weblogic1","t3://localhost:7001") edit() startEdit()
# set CMO to the server log configcd("Servers/CRMDemo_server1/Log/CRMDemo_server1")ls()
# change LogMBean attributes set("FileMinSize", 400)
# list the current directory to confirm the new attribute values ls()
# save and activate the changes save() activate(block="true")
# all done... exit()
References
- WebLogic Server MBean Reference
- Getting Runtime Information
- Oracle® Fusion Middleware WebLogic Scripting Tool Command Reference 11g Release 1 (10.3.3)
- My "enable debug logging" in OAM WLST script
- Configuring WebLogic Logging Services
- weblogic.Server Command-Line Reference
- How to List Current Message Levels of All Loggers Using WLST?
No comments:
Post a Comment