manageODR.py script

Use the manageODR.py script to manage custom logging and create a cluster of on demand routers (ODR).


Location

The manageODR.py script is located in the app_server_root/bin directory. Before running this script, ensure that you have the environment variable WAS_HOME configured to point to the directory of the WebSphere installation.


Operations

We can perform the following operations with the manageODR.py script:

The following example shows how to create an HTTP ODR named odr, on node 1:

The following example shows how to convert an ODR named odr on node node1 to an ODR cluster named ODRCluster: wsadmin.sh -f manageODR.py -lang jython convertToCluster node1:odr ODRCluster

The following example shows how to add a custom log rule to put all requests whose service time is longer than 2 seconds in the slow.log custom log, and include the application server to which the request was sent and the service time: wsadmin.sh -f manageODR.py -lang jython insertCustomLogRule myNode02:odr1 1 "service.time > 2000" "slow.log %t %r %Z %T"

The following example shows how to add a custom log rule to put all 503 responses in 503.log. The rule is added at position 2. If there is an existing rule at position 2, the new rule is inserted before the existing rule. wsadmin.sh -f manageODR.py -lang jython insertCustomLogRule myNode02:odr1 2 "response.code = 503" "503.log %t %r %s

The following example shows how to add a custom log rule at position 1 to log errors that can occur when writing a response to a client in the response.write.error.log: wsadmin.sh -f manageODR.py -lang jython insertCustomLogRule node1:odr 1 "response.write.error" "response.write.error.log %t %r %s"


Related concepts

  • Custom log file format
  • Cell affinity function


    Related tasks

  • Configure custom logs
  • Create ODRs
  • Configure ODRs
  • Enable cell affinity
  • Configure cell affinity in a multi-tiered environment
  • Use generic server clusters with cell affinity