Before you begin
Before starting this task, the wsadmin tool must be running. See the Starting the wsadmin scripting client article for more information.Why and when to perform this task
Use the following example to configure the rotation policy settings for Java virtual machine (JVM) logs:
Steps for this task
set s1 [$AdminConfig getid /Cell:mycell/Node:mynode/Server:server1/]
s1 = AdminConfig.getid('/Cell:mycell/Node:mynode/Server:server1/') print s1
set | is a Jacl command |
s1 | is a variable name |
$ | is a Jacl operator for substituting a variable name with its value |
AdminConfig | is an object representing the WebSphere Application Server configuration |
getid | is an AdminConfig command |
Cell | is the object type |
mycell | is the name of the object that will be modified |
Node | is the object type |
mynode | is the name of the object that will be modified |
Server | is the object type |
server1 | is the name of the object that will be modified |
a Jython command |
server1(cells/mycell/nodes/mynode/servers/server1|server.xml#Server_1)
The following example identifies the output stream log:
set log [$AdminConfig showAttribute $s1 outputStreamRedirect]
log = AdminConfig.showAttribute(s1, 'outputStreamRedirect')
set log [$AdminConfig showAttribute $s1 errorStreamRedirect]
log = AdminConfig.showAttribute(s1, 'errorStreamRedirect')
(cells/mycell/nodes/mynode/servers/server1|server.xml#StreamRedirect_2)
$AdminConfig show $log
AdminConfig.show(log)
{baseHour 24} {fileName ${SERVER_LOG_ROOT}/SystemOut.log} {formatWrites true} {maxNumberOfBackupFiles 1} {messageFormatKind BASIC} {rolloverPeriod 24} {rolloverSize 1} {rolloverType SIZE} {suppressStackTrace false} {suppressWrites false}
The following example sets the rotation log file size to two megabytes:
$AdminConfig modify $log {{rolloverSize 2}}
AdminConfig.modify(log, ['rolloverSize', 2])
$AdminConfig modify $log {{rolloverType TIME} {rolloverPeriod 12} {baseHour 24}}
AdminConfig.modify(log, [['rolloverType', 'TIME'] ['rolloverPeriod', 12] ['baseHour', 24]])
$AdminConfig modify $log {{rolloverType BOTH} {rolloverSize 2} {rolloverPeriod 12} {baseHour 24}}
AdminConfig.modify(log, [['rolloverType', 'BOTH'] ['rolloverSize', 2] ['rolloverPeriod', 12] ['baseHour', 24]])
Related concepts
AdminConfig object for scripted administration
Related reference
Commands for the AdminConfig object