WAS v8.5 > Script the application serving environment (wsadmin) > Use properties files to manage system configuration > Manage specific configuration objects using properties files > Work with server properties filesModify the errorStreamRedirect attribute of StreamRedirect properties files
We can use properties files to change errorStreamRedirect attribute of a server. The errorStreamRedirect attribute is of type StreamRedirect.
Determine the changes to make to the errorStreamRedirect attribute of a server configuration object.
We can create a server by creating a Server properties file template and then applying the template. See the topic on server properties files.
Start the wsadmin scripting tool. To start wsadmin using the Jython language, run the wsadmin -lang jython command from the bin directory of the server profile. Using a properties file, we can modify the errorStreamRedirect attribute of a server.
Run administrative commands using wsadmin to change a properties file for a StreamRedirect object, validate the properties, and apply them to your configuration.
Actions for the errorStreamRedirect attribute of StreamRedirect properties files. We can modify the errorStreamRedirect attribute value.
Action Procedure create Not available modify Edit properties and then run the applyConfigProperties command. delete Not available Optionally, we can use interactive mode with the commands:
AdminTask.command_name('-interactive')
- Change the errorStreamRedirect attribute in a StreamRedirect properties file.
Open an editor and specify the errorStreamRedirect attribute under a server in a properties file. We can copy the following example properties into an editor and modify the properties as needed for the situation. The example shows an errorStreamRedirect attribute of type StreamRedirect:
# # Header # ResourceType=StreamRedirect ImplementingResourceType=GenericType ResourceId=Cell=!{cellName}:Node=!{nodeName}:Server=!{serverName}:StreamRedirect=outputStreamRedirect# AttributeInfo=errorStreamRedirect #DELETE=true # # #Properties # formatWrites=true #boolean,default(false) maxNumberOfBackupFiles=5 #integer,default(0) suppressStackTrace=false #boolean,default(false) rolloverType=SIZE #ENUM(TIME|SIZE|NONE|BOTH),default(SIZE) suppressWrites=false #boolean,default(false) baseHour=24 #integer,default(0) fileName="${SERVER_LOG_ROOT}/SystemOut6.log" messageFormatKind=BASIC #ENUM(BASIC|ADVANCED),default(BASIC) rolloverSize=1 #integer,default(0) rolloverPeriod=24 #integer,default(0) EnvironmentVariablesSection # #Environment Variables cellName=WASCell06 serverName=myServer nodeName=WASNode04
- Run the applyConfigProperties command to change the errorStreamRedirect attribute of a server.
Running the applyConfigProperties command applies the properties file to the configuration. In this Jython example, the optional -reportFileName parameter produces a report named report.txt:
AdminTask.applyConfigProperties(['-propertiesFileName myObjectType.props -reportFileName report.txt'])
Results
We can use the properties file to manage the StreamRedirect object.
Save the changes to your configuration.
Related
Work with server properties files
Create server, cluster, application, or authorization group objects using properties files and wsadmin scripting
Extracting properties files using wsadmin.sh
Delete server, cluster, application, or authorization group objects using properties files
Reference:
PropertiesBasedConfiguration command group for AdminTask using wsadmin.sh