Thursday, 29 December 2016

Adding logger properties to Websphere Application Server to generate log files

It is a good practice to add loggers to our code, as it will make the code debugging easier. The below steps illustrates how to add logger properties to Websphere Application Server so that the loggers that are added in the code will be executed when the application is running on Websphere Application Server.

Ø Login to WAS

Ø  Click on Servers -> Server Types -> WebSphere application servers

Ø  Click the server in which the application or software is installed. (Here it is Samples Server)

Ø  Expand Java and Process Management which is present in Server Infrastructure. Click Process definition.

Ø  Click on Java Virtual Machine present in Additional Properties Section.

Ø  Click the Custom Properties link present in Additional Properties.

Ø  Click the New Button (Note: Properties can be added only through the user profiles with admin privileges.)

Ø  Add the required property. For ex., let us add a property with name rlogger.appender.rollingfileappender in the name field. Add true as value in value field. Then click on apply.

Ø  Now this property will be added to the local configuration.
Ø  Click on Save directly to the master configuration, so that changes are done at Main profile level i.e., at manager level.
Ø  Add the remaining properties in the same manner.

Ø  Restart the server.
Ø  To make sure that the properties are added correctly, we can check it by viewing server.xml file which is present at the installed directory off websphere.
Ø  The default location is <INSTALLED DIR>IBM\WebSphere\AppServer\profiles\ODMSample8800\config\cells\SamplesCell\nodes\SamplesNode\servers\SamplesServer
Ø  Here ODMSample8800 is the ODM 8.8 software which is installed in the AppServer profile.
Ø  We can view the properties under the <jvmEntries></jvmEntries>



0 comments:

Post a Comment