Debug Logs
Nexaweb Debug Logs
Nexaweb server and client generate various types of application messages that you can use to debug your application. In addition, you can specify a log-level at which Nexaweb displays the content of these messages.
Nexaweb displays these various types of application messages at the Nexaweb console and stores them in a ServletContext log on your Web application server.
Nexaweb appends the message type to the beginning of any messages that the application generates, so that you can determine what part of the application generated the mesage.
Application Messages
Nexaweb Server and Client generate application message types differently. The Nexaweb server generates a default set of message types and additional types based upon the Nexaweb features that your application uses. Nexaweb client generates a default set of message types only.
Nexaweb Server and Client generate the following types of application messages by default:
Message Type | Description | Server or Client |
Macrohandler | Messages about the definition of Macros. | Both |
Messaging | Messages not handled by the application's MessageListener class. | Both |
FormatUtils | Messages about Nexaweb's automatic type conversion. | Both |
XUpdate | Messages detailing the results of XUpdate statements. | Both |
Macro | Messages about a Macro's execution. | Client |
WebServicesBroker | Messages about web services. | Client |
PrintService | Messages about PDF Printing. | Server, Desktopclient |
To determine a complete list of the types of application messages that the Nexaweb server generates, access the Nexaweb Server Management console as follows:
- Enter <application-context>/Nexaweb/Services in the Address/Location field of a browser, or
Press the F3 Key from any running Nexaweb client application.
The Nexaweb Server Management console page appears. - Click Log Names under Reports on the right side of the page.
The Nexaweb Server Management console page displays a list of all of the log names currently in use.
Message Log Levels
Nexaweb provides a number of log-levels for messages it captures in log files. The main difference between the various log-levels is verbosity; some log-levels include messages from fewer or greater of the other log-levels.
In Nexaweb Platform 4.5+, you can select which log-level messages you want to capture in the logs generated by Nexaweb server or the client.
Note: For earlier versions of Nexaweb Platform, you can select which log-level messages you want to capture in the logs generated by Nexaweb server only. For the logs generated by the Nexaweb client, you can change the log level only to debug log-level messages.
Nexaweb provides the following log-levels for application messages:
Log-Level | Description | Server Logs | Client Logs |
debug | Includes messages from all log -levels. | Configurable | Configurable - All Nexaweb Platform versions |
info | Includes messages from all log-levels except, debug. Default log-level for Nexaweb Server and Client logs. | Configurable | Configurable - Nexaweb Platform 4.5+ Default level when debug is not set - Nexaweb Platform prior to version 4.5+ |
exception | Includes exception and error messages. Exception messages indicate behavior that might affect a current operation. | Configurable | Default log level - Nexaweb Platform 4.5+ Not configurable - Nexaweb Platform prior to version 4.5+ |
error | Includes error messages only. Exception messages indicate behavior from which the application may not be able to recover. | Configurable | Configurable - Nexaweb Platform 4.5+ Not configurable - Nexaweb Platform prior to version 4.5+ |
To configure log-levels for various application message types, see the Configuring Server Debug Logs or Configuring Client Debug Logs sections.
Configuring Debug Logs
You configure debug logs in the Nexaweb Server and Client configuration files.
Configuration File | Name | Location |
client | nexaweb-client.xml | application project\WebContent\WEB-INF |
server | nexaweb-server.xml | Nexaweb Platform 4.x\doc |
Configuring Server Debug Logs
The server configuration file, nexaweb-server.xml, contains a Logging Configuration section where you can configure various aspects of Nexaweb server logging functionality including:
- Message log-levels
- Message format
- Consumers to which Nexaweb server sends log messages
- Email consumer properties
The following sections describe how to configure various aspects of server log files.
Configuring Message Log-Levels
- Default log-level for all application message types
- Log-levels for individual application message types
Tag | Description |
<default-log-level> | Specifies which log-level to capture for all application message types in log files by default. |
<log name log-level> | Specifies which log-level to capture for the specified application message type. |
<log-configuration default-log-level="info"> <log name="XUpdate" log-level="debug"/> <log name="SessionManager" log-level="debug"/> </log-configuration>
Configuring Message Formats
In the <output-format> section, you can configure the format of messages to appear in the consumers you set-up to receive log messages. You can specify the content to appear in messages and the format of dates.
Tag | Description |
<format> | Specifies the format of log messages by specifying the range of content to appear in the message. See following table for list of possible message content. |
<date-format> | Specifies date format, if you selected date as part of the range of content to appear. |
Message Content Options
Content | Description | Symbol |
Type | Includes the log level of the message. | {0} |
Formatted date | The date Nexaweb generated the messages | {1} |
Threadname | Specifies the name of the thread that generated the message. | {2} |
Message | Information about the event that occurred | {3} |
LogName | The log in which Nexaweb captured this event. | {4} |
You specify the range of content to appear in the log message in a space separated list between straight brackets as follows:
<format> [{1} {2} {3} {4}] </format>
This example includes the formatted date, threadname, message and logname.
In addition, you can format the message using punctuation that appears between the pieces of content included in the message similar to the following:
<format> [{1}: {2} {3} {4}] </format>
In this example the message appears as follows:
Configuring Consumers to which Nexaweb Server Sends Log Messages
You can configure the following server log message consumers:
Consumer | Tag | Description |
Web appllication log | <consumer class="com.nexaweb.server. log.WebApplicationLogConsumer" /> | Including this tag in the Logging Configuration causes Nexaweb to output log messages to the ServletContext log of the Web Application server. You can configure Nexaweb to send messages only to one ServletContext log per application. |
Console log | <consumer class="com.nexaweb.server. log.ConsoleLogConsumer" /> | Including this tag in the Logging Configuration causes Nexaweb to output log messages to the Nexaweb console log for display in the Nexaweb Studio console while running an application. |
<consumer class="com.nexaweb.server. log.EmailLogConsumer" /> | Including this tag in the Logging Configuration causes Nexaweb to output log messages through email. In addition to specifying Nexaweb to send log messages through email, you configure the email address to which Nexaweb sends those messages and how Nexaweb formats those messages. |
Tag | Description |
<mail-level> </mail-level> | Specifies what level of log messages Nexaweb sends through email. This filters out message levels from the range of levels specified by the <default-log-level> in the <log-configuration> section. Options: |
<properties> </properties> | In this section, you configure properties of the email consumer including To and From addresses, subject content, and message format within body of email. See the following table for descriptions of commonly used <properties> tags. In addition to the email consumer properties listed in the following table, you can use any properties described in the JavaMail API Design Specification or the JavaMail API Documentation available at http://java.sun.com/products/javamail/reference/api/index.html. |
Tag | Description |
<property name="mail.transport.protocol" value=smtp/> | Specifies the default Message Access Protocol. |
<<from-name>Nexaweb Administrator</from-name> | Specifies the name to include in the From portion of outbound emails. |
<from-address>Nexaweb Administrator</from- address> | Specifies the address to include in the From portion of outbound emails. |
<recipient>administrator@companyname.com</recipient> | Specifies a recipient of outbound emails. You can add multiple entries of this tag to send emails to multiple recipients. |
<mail-host>itsupport.companyname.com</mailhost> | Specifies host name or IP address of the mail server. Required. |
<mail-username>admin@companyname</ mail-username> | Username to use for SMTP server, if required. |
mail-password>admin@companyname</ mail- password > | Password to use for SMTP server, if required. |
<mime-type>text/html</mime-type> | Specifies either text/plain or text/html as the mime type of the body of the email. |
<mail-subject-format> output-format </ mail-subject-format> | Specifies what information to appear in the subject line of the email, using the syntax described in the <output-format> section of Configuring Message Format. |
Configuring Client Debug Logs
The client configuration file, nexaweb-client.xml, contains a Client Log Settings section.
In Nexaweb Platform 4.5+, you can configure the following for client logs:
- Message log-levels
- Consumers to which Nexaweb client sends log messages
Configuring Message Log-Levels
In Nexaweb Platform prior to version 4.5+, all client logs capture info level messages by default, which include exception and error messages. In this section you can configure individual logs to capture debug level messages, which include messages from all log-levels.
In Nexaweb Platform 4.5+, you can configure the following in this section:
- Default log-level for all application message types
- Log-levels for individual application message types
Tag | Description |
<default-log-level> | Specifies which log-level to capture for all application message types in log files by default. |
<log name log-level> | Specifies which log-level to capture for the specified application message type. |
For example:
<log-configuration default-log-level="info"> <log name="XUpdate" log-level="debug"/> <log name="SessionManager" log-level="debug"/> </log-configuration>
Configuring Consumers to which Nexaweb Client Sends Log Messages
You can configure the following log message consumers:
Consumer | Tag | Description |
Console log | <consumer class="com.nexaweb.util. ConsoleLogConsumer" /> | Including this tag in the Logging Configuration of the nexaweb-client.xml file causes Nexaweb to output all client log messages to the Nexaweb console log for display in the Nexaweb Studio console while running an application.. |
Dialog log | <consumer class="com.nexaweb.client.log. DialogLogConsumer" /> | Including this tag in the Logging Configuration of the nexaweb-client.xml file causes Nexaweb to output client error/exception messages to a modal dialog. |