WebFacing applications use WebSphere® Application Server Common Base Event logging to diagnose runtime application problems. When you run a WebFacing application on an application server, logging information is sent by default to the console of the application server. For more information about logging and tracing in WebSphere Application Server, see the information center for your level of WebSphere Application Server, for example, http://publib.boulder.ibm.com/infocenter/wasinfo/v8r0/index.jsp?topic=/com.ibm.websphere.nd.multiplatform.doc/info/ae/ae/ttrb_addtrace.html.
You can configure the logging level of the WebFacing application logger (com.ibm.etools.iseries.webfacing.context_root_name) using the administrative console in WebSphere Application Server. For information about configuring the logger, see the Information Center for your level of WebSphere Application Server and search for Configuring logging properties using the administrative console.
You can also configure the logger details level as well as other settings for the WebFacing application logger by using the webfacinglogging.properties configuration file.
By default, the log message in WebSphere Application Server is written to the console of the application server, and the log record is written to the WebSphere Application Server activity.log file. If you turn on tracing through the application server administrative console, the trace information is written to the trace.log file of the application server instance. When tracing is enabled, all log messages are logged to trace.log in simple text format, and all log records with log level CONFIG and above, are also logged to activity.log in Common Base Event format. For information about turning on tracing in WebSphere Application Server, see the information center for your level of WebSphere Application Server and search for Enabling trace at server startup.
You can also configure your settings for WebFacing applications to separate the runtime logging and tracing information into different files in the system where your application server is running. Log records, where the log level is above or equal to CONFIG, are written to a log file and a trace file, if tracing is enabled for this logger. Trace records, where the log level is below CONFIG, are written to a trace file. See the Configuration settings for a WebFacing application section below for the properties that enable this feature.
The log and trace files are organized by each HTTP session. The name of the log file is sessionid.log, where sessionid is the session id of the browser accessing the WebFacing application. Similarly, the trace file name is sessionid.trace. The log file related to a WebFacing application is written into a directory with the same name as the context root name of your Web project containing the WebFacing application. See the logFileLocation property in the Configuration settings for a WebFacing application section below for information about configuring the location of your WebFacing log and trace files.
If you just want to look at the message text of your log record, you can configure your settings to format your log record to be written as a simple string. See the useXMLFormatForCBELogging property in the Configuration settings for a WebFacing application section below for information about controlling the format of your Common Base Event log record.
You can configure the logging and tracing settings of a WebFacing application through the webfacinglogging.properties file, which is located in the WebContent/WEB-INF/classes for a WebFacing Web project. Here you see the settings inside this file.
# Control the level of runtime logging # The levels in descending order are: # SEVERE (highest value) # WARNING # INFO # CONFIG # FINE # FINER # FINEST (lowest value) # In addition, there is a level OFF that can be used to turn off logging, # and a level ALL that can be used to enable logging/tracing of all messages. # See the Java document for the java.util.logging class for more information. # The levels above or equal to CONFIG are considered logging. # The levels below CONFIG are considered tracing. # Default is SEVERE. com.ibm.etools.iseries.webfacing.level=SEVERE # Control if the logging level set in this file will override # the static configuration settings of log detail levels in WAS # Valid values are: # true - default # false com.ibm.etools.iseries.webfacing.overrideAdminLevelSetting=true # Control which directory the log and trace files will be written to. # A subdirectory with the same name as the web-app will be created # to store all the log and trace files of a specific web application. # This value will be used when property "logToFile" is set to true. # "%WASTraceDir" - trace directory of the WAS server instance. # By default, it is the SERVER_LOG_ROOT variable defined. # in the WAS server. This value will be used as default value # if the web application is running in a WAS environment. # If this value is not available, "%h/iserieslogs" will be used as # default. # "%h" - the value of the "user.home" system property # "%h/iserieslogs" will be used as default value # "%t" - the value of the system temporary directory # "." - the value of the WEB-INF directory # "/" the local pathname separator # # Example for workstation full path: # "c:\\my_directory\\my_log_dir" # Please notice that double backslash is needed here. # # Example for iSeries IFS full path # "/home/my_id/my_log_dir" com.ibm.etools.iseries.webfacing.logFileLocation=%WASTraceDir # Control if log and trace information will be written to files. # Valid values are: # true # false - default com.ibm.etools.iseries.webfacing.logToFile=false # Control if log and trace information will be written to console. # Valid values are: # true # false - default com.ibm.etools.iseries.webfacing.logToConsole=false # Control if parent's output handler of this logger will also be used. # If this property is set to false, the log or tracing information will # not be written to the WAS activity.log or trace.log # Valid values are: # true - default # false com.ibm.etools.iseries.webfacing.useParentHandler=true # Control the format of the Java log records written to a file. # If this property is set to true, the log records written to the # log file will be in XML format. # See the Java documentation for the java.util.logging.XMLFormatter class # for more information. # If this property is set to false, the log records written to the # log file will be in simple string format. # Valid values are: # true - default # false com.ibm.etools.iseries.webfacing.useXMLFormatForJSR47Logging=true # Control the format in which Common Base Event log records are written to a file. # If this property is set to true, the log records written to the # log file will be in Common Base Event # XML format. # If this property is set to false, the log records written to the log # file will be in simple string format. # Valid values are: # true - default # false com.ibm.etools.iseries.webfacing.useXMLFormatForCBELogging=true #Control how many log files will be created for each web application # before the oldest log file is deleted. com.ibm.etools.iseries.maxlog=3