Every WebSphere Application Server server has the same directory structure by default and within that there is always a "logs" directory where the logs for that server are held. For each server instance in the profile, there is a specific folder under logs for that server. For example, if you have two servers in your AppSrv01 profile, plus the node agent, you will have three folders under "logs":
There are four key log files that are created for every server:
- StartServer.log - all activity as the server was issued a start command
- StopServer.log - all activity as the server was issued a stop command
- SystemErr.log - any errors being thrown by the server instance
- SystemOut.log - all activity as the server runs, essentially a server console output
There is also a directory called "ffdc" under the logs directory that contains exception log entries.
The log files can become very large and can only be deleted when the server is down. Therefore, it is a good practice to set up rollover logs. You can do this through the ISC Troubleshooting menu.
The logs and trace menu allows you to configure the logs, their location, their size, and their level of diagnostic detail. Each server is listed separately and each has specific configuration settings that apply to that server only. You cannot change the log settings for multiple servers at once.
The following figure shows the ISC Logs and trace panel on our system. We start by selecting one of the listed servers.
The general Properties lists options for what to do next. We use two menus:
- JVM Logs - where you can view and configure the size and location of the log files
- Change Log Detail Levels - where you can adjust the level of detail. In most cases the detail level is set to *=info and this should not be changed unless instructed by IBM under a support call.
To start with, you can review the logs by going into JVM Logs and choosing the “Runtime
tab. Here you see the critical SystemOut.log and SystemErr.log. These two files tell you what the server is doing and whether any errors are being generated. You can also see the location of the log files if you wanted to connect directly to the server and retrieve or read the log files from the file system.
The ISC has a built-in log file view that renders the current logs if you select "View" from the menu above. The log files are then read in line by line and you can navigate through them. The important thing to note about WebSphere Application Server log files is that they can become large and difficult to read through the small built-in viewer and it is usually a better idea to retrieve the files from the file system for reading.
The layout of a WebSphere Application Server log file is simple to spot any errors as, when properly aligned, there is a center column showing the status of each message, for example:
- I = informational message
- W = warning message
- E = error message
- F = fatal message
- C = configuration message
To ensure the log files do not grow too large, you can also configure log file sizes for rollover and historical retention. You do this under the "Configuration: tab:
Log file retention instructs the server to create a new instance of the SystemOut (or SystemErr) log file when it reaches a certain size or age. The recommendation is to have these files at least 20 MB in size, depending on how your internal monitoring and backup systems work. You might change to make the log file rollover time dependent instead.
As each file is rolled over, the new file is created but the historical files are not removed unless you specifically configure that. In the configuration screen, you can also specify the number of historical files to retain, in the above example, we have chosen to create log files of 20 MB in size for SystemOut.log and retain 10 historical instances. We have the same options to set for the SystemErr.logs. Because these are configuration settings, they will not take effect until the server they are being applied to is restarted.