WebSphere Virtual Enterprise (formerly Operations Optimization), Version 6.1
             Operating Systems: AIX, HP-UX, Linux, Solaris, Windows, z/OS


Configuring custom logs

You can configure custom logs through the wsadmin command with the $AdminConfig create, modify, and remove commands. Custom log configuration is handled through the ruleset configuration objects. Validation is limited to type checking. More thorough validation is performed during an on demand router (ODR) startup by issuing runtime exceptions to SystemOut.

Before you begin

[Version 6.1.0.5 only]
New feature: You can use this feature if you have Version 6.1.0.5 or later installed. Use the Ruleset administrative tasks for information on how to configure custom logs. newfeat

About this task

The custom log must be configured at the wsadmin command line.

You can list the attributes for the configuration object as follows:

Procedure

  1. The following shows the wsadmin command for listing the configurable attributes for the ruleset and the results:
    wsadmin> $AdminConfig attributes Ruleset    
    "defaultActions Action*"
    "defaultContinue Boolean"
    "name String"
    "properties Property(DiscoverableDescriptiveProperty, TypedProperty, DescriptiveProperty)*""rules Rule*""type String"
  2. The following shows the wsadmin command for listing the configurable attributes for the rule and the results:
    wsadmin> $AdminConfig attributes Rule    
    "actions Action*"
    "expression String"
    "name String"
    "priority Integer"
    "properties Property(DiscoverableDescriptiveProperty, TypedProperty, DescriptiveProperty)*"
    
  3. The following shows the wsadmin command for listing the configurable attributes for the action and the results:
    wsadmin> $AdminConfig attributes Action    
    "continue Boolean"
    "name String"
    "priority Integer"
    "properties Property(DiscoverableDescriptiveProperty, TypedProperty, DescriptiveProperty)*"
    "type String"
    "value String"

Example

The following list shows you various commands and their outputs:
  1. wsadmin>$AdminConfig list Server

    Outputs the ODR for creating a ruleset:

    TestClusterA(cells/dabtcCell01/dynamicclusters/TestClusterA/servers/TestClusterA|server.xml#Server_1224275288921)
    TestClusterA_dabtcNode01(cells/dabtcCell01/nodes/dabtcNode01/servers/TestClusterA_dabtcNode01|server.xml#Server_1224346718671)
    TestClusterA_dabtcNode01_1(cells/dabtcCell01/nodes/dabtcNode01/servers/TestClusterA_dabtcNode01_1|server.xml#Server_1224597699515)
    dmgr(cells/dabtcCell01/nodes/dabtcCellManager01/servers/dmgr|server.xml#Server_1)dmgr(cells/dabtcCell01/nodes/dabtcCellManager07/servers/dmgr|
    server.xml#Server_1)nodeagent(cells/dabtcCell01/nodes/dabtcNode01/servers/nodeagent|server.xml#Server_1120677326772)
    odr1(cells/dabtcCell01/nodes/dabtcNode01/servers/odr1|server.xml#Server_1224344819218)
    server1(cells/dabtcCell01/nodes/dabtcNode01/servers/server1|server.xml#Server_1224273173203)
  2. wsadmin>$AdminConfig create Ruleset (cells/dabtcCell01/nodes/dabtcNode01/servers/odr1|server.xml#Server_1224344819218) { {name MySampleRuleset} {type HTTP} {defaultContinue true}}
    Outputs the ruleset ID for creating a rule:
    MySampleRuleset(cells/dabtcCell01/nodes/dabtcNode01/servers/odr1/ruleset/MySampleRuleset|ruleset.xml#Ruleset_1225376443265)
  3. $AdminConfig create Rule -
    Outputs the rule ID for creating the action:
    wsadmin>$AdminConfig create Rule (cells/dabtcCell01/nodes/dabtcNode01/servers/odr1/ruleset/MySampleRuleset|ruleset.xml
    #Ruleset_1225376443265)  {{name MySampleRule} {priority 0} {expression "virtualhost <> 'badvhost'"}}
  4. wsadmin>$AdminConfig create Action (cells/dabtcCell01/nodes/dabtcNode01/servers/odr1/ruleset/MySampleRuleset|ruleset.xml #Rule_1225376555781) {{name MySampleAction} {type log} {continue false} {value "MySampleCustom.log %r %T %z %Z"}}
    Outputs the action ID for modifying the action:
    MySampleAction(cells/dabtcCell01/nodes/dabtcNode01/servers/odr1/ruleset/MySampleRuleset|ruleset.xml#Action_1225376719437)
  5. wsadmin>$AdminConfig modify (cells/dabtcCell01/nodes/dabtcNode01/servers/odr1/ruleset/MySampleRuleset|ruleset.xml#Action _1225376719437) {{value "MySampleCustom.log %r %T %h %z %Z@MySampleCustom2.log %r %s"}}
    Modifies the action, by adding the %h parameter, and adding a new log format for a second custom log. The log formats are separated by @, resulting in two custom logs.
    Note: Any of the Action attributes can be modified, and Ruleset/Rule can be modified in the same way.
  6. Save your changes when finished:$AdminConfig save

What to do next

Look at the resulting two logs located in <WAS_ROOT>profiles/AppSrv01/logs/odr1. You should see results similar to the following, based on your inputs:
"GET /A/ServerInfo HTTP/1.1" 62 localhost 9.26.168.190 dabtcCell01/dabtcNode01/TestClusterA_dabtcNode01
"GET /A/ServerInfo HTTP/1.1" 16 localhost 9.25.129.176 dabtcCell01/dabtcNode01/TestClusterA_dabtcNode01_1
"GET /A/ServerInfo HTTP/1.1" 16 localhost 9.23.172.192 dabtcCell01/dabtcNode01/TestClusterA_dabtcNode01
"GET /A/ServerInfo HTTP/1.1" 0 localhost 9.24.142.193 dabtcCell01/dabtcNode01/TestClusterA_dabtcNode01_1
"GET /A/ServerInfo HTTP/1.1" 16 localhost 9.23.122.191 dabtcCell01/dabtcNode01/TestClusterA_dabtcNode01
"GET /A/ServerInfo HTTP/1.1" 16 localhost 9.27.138.119 dabtcCell01/dabtcNode01/TestClusterA_dabtcNode01_1
"GET /A/ServerInfo HTTP/1.1" 200
"GET /A/ServerInfo HTTP/1.1" 200
"GET /A/ServerInfo HTTP/1.1" 200
"GET /A/ServerInfo HTTP/1.1" 200
"GET /A/ServerInfo HTTP/1.1" 200
"GET /A/ServerInfo HTTP/1.1" 200



Related reference
Task topic    

Terms of Use | Feedback

Last updated: Oct 30, 2009 6:17:06 PM EDT
http://publib.boulder.ibm.com/infocenter/wxdinfo/v6r1/index.jsp?topic=/com.ibm.websphere.ops.doc/info/odoe_task/txdcustomlog.html