For LINUX platformsFor Windows platforms

Viewing trace and message log files by using developer tools

You can view trace and message log files for either local or remote servers by using WebSphere Developer Tools.

Before you begin

  • To view the trace file, you must enable tracing by specifying the traceformat and tracespecification settings in the server.xml file or the bootstrap.properties file. For more information about enabling tracing, see Logging and Trace.
  • You can change the default log file names from messages.log and trace.log, and the default directory name from WLP_OUTPUT_DIR/serverName/logs by changing any of the configuration files.
    • Configuration files include server.xml, bootstrap.properties, and server.properties.
  • Actions for local servers:
    • Ensure that the log file is in the log directory that you specified. Otherwise, the menu actions for the local server are disabled.
    • If you change the bootstrap.properties file or the server.env file, you must restart the server for changes to take effect. Menu actions are temporarily disabled until the server is restarted.
    • If the same configuration setting is specified in more than one configuration file, the setting in the server.xml file overrides the other values.
  • Actions for remote servers:
    • Ensure that the server is running. If it is not running, menu actions are not displayed.
    • If you change the default location of a log file, include remote access by adding either a ReadDir or a WriteDir configuration to your server.xml file to indicate the log location. The following example shows how to add remote access.
      
      <logging logDirectory="${server.output.dir}/log_a" maxFiles="10" traceFormat="BASIC"
               traceSpecification="com.ibm.ws.webcontainer*=all:com.ibm.wsspi.webcontainer*=all:HTTPChannel=all"/>
      <remoteFileAccess>
           <writeDir >${wlp.user.dir}</writeDir>
           <writeDir>${server.config.dir}</writeDir>
           <writeDir>${server.output.dir}</writeDir>
           <writeDir>${server.output.dir}/log_a</writeDir>
      </remoteFileAccess>

Procedure

  1. To view a list of servers, select Window > Show View > Servers.
  2. Right-click a server.
    • To view the trace log file, select Open Log Files > Trace File from the menu.
    • To view the messages log file, select Open Log Files > Message Log File from the menu.

    For remote servers, downloading log files can take several seconds depending on the size of the log file.

Results

The log file that you selected is displayed in the default editor. The following example shows records in a message log file.

[3/3/11 23:01:30:147 EST] 0000000f ApplicationMg Z WSVR0221I: Application started: DefaultApplication

In this example, [3/3/11 23:01:30:147 EST] is the time stamp, 0000000f is the thread ID, ApplicationMg is the logger, Z is the level, WSVR0221I is the message ID, and Application started: DefaultApplication is the message.