Modify the errorStreamRedirect attribute of StreamRedirect properties files
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.
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.
Use a properties file to 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 the configuration.
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')
Tasks
- 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 our 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'])
Use the properties file to configure and manage the StreamRedirect object.
What to do next
Save the changes to the configuration.
Work with server properties files Create server, cluster, application, or authorization group objects using properties files and wsadmin scripting Extracting properties files Deleting server, cluster, application, or authorization group objects using properties files PropertiesBasedConfiguration .