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 TypeDescriptionServer or Client
MacrohandlerMessages about the definition of Macros.Both
MessagingMessages not handled by the application's MessageListener class.Both
FormatUtilsMessages about Nexaweb's automatic type conversion.Both
XUpdateMessages detailing the results of XUpdate statements.Both
MacroMessages about a Macro's execution.Client
WebServicesBrokerMessages about web services.Client
PrintServiceMessages 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:

  1. 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.
  2. 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-LevelDescriptionServer LogsClient Logs
debugIncludes messages from all log -levels.ConfigurableConfigurable - All Nexaweb Platform versions
infoIncludes messages from all log-levels except, debug.

Default log-level for Nexaweb Server and Client logs.

ConfigurableConfigurable - Nexaweb Platform 4.5+

Default level when debug is not set - Nexaweb Platform prior to version 4.5+

exceptionIncludes exception and error messages.

Exception messages indicate behavior that might affect a current operation.

ConfigurableDefault log level - Nexaweb Platform 4.5+

Not configurable - Nexaweb Platform prior to version 4.5+

errorIncludes error messages only.

Exception messages indicate behavior from which the application may not be able to recover.

ConfigurableConfigurable - 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 FileNameLocation
clientnexaweb-client.xmlapplication project\WebContent\WEB-INF
servernexaweb-server.xmlNexaweb 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

You configure message log-levels in the <log-configuration> section including:
  • Default log-level for all application message types
  • Log-levels for individual application message types
The <log-configuration> section contains the following tags:
 

 

TagDescription
<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>

 

This example sets the default log level for all logs to info. It also overrides the default log level for the XUpdate and SessionManager logs by setting their log levels to debug. 

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.

The <output-format> section contains the following tags:
 

 

TagDescription
<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

 

ContentDescriptionSymbol
TypeIncludes the log level of the message.{0}
Formatted dateThe date Nexaweb generated the messages{1}
ThreadnameSpecifies the name of the thread that generated the message.{2}
MessageInformation about the event that occurred{3}
LogNameThe 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:

<date-format>
You can specify the format of the date that appears in messages using any valid java.text.SimpleDateFormat construction, similar to the following:
<date-format>EEE-d-MMM-yyyy-HH:mm:ss</date-format>
This example displays a date formatted as follows: Wed-4-Jul-2006-12:08:56
For complete information on java.text.SimpleDateFormat see http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html.

Configuring Consumers to which Nexaweb Server Sends Log Messages

In the <consumers> section, you specify the consumers to which Nexaweb server sends log messages. Each consumer that you include in this section specifies a unique method\recipient for log messages.

You can configure the following server log message consumers:

 

ConsumerTagDescription
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.
Email <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.

 

  

Use the following tags to configure how the email consumer sends log messages:
 

 

TagDescription
<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:
Debug – Nexaweb sends messages from all levels.
(Note: Nexaweb never sends debug level messages through email.)
Info - Nexaweb sends messages from all levels except debug.
Error – Nexaweb sends error and exception messages.
Exception – Nexaweb sends exception messages only.

<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.

 

Commonly used Email consumer <properties> tags include the following:
 
TagDescription
<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

You configure message log-levels in the <log-configuration> section.

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
The <log-configuration> section contains the following tags:
 

 

TagDescription
<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>
 
This example sets the default log level for all logs to info. It also overrides the default log level for the XUpdate and SessionManager logs by setting their log levels to debug. 

Configuring Consumers to which Nexaweb Client Sends Log Messages

In the <consumers> section, you specify the consumers to which Nexaweb client sends log messages. Each consumer that you include in this section specifies a unique method\recipient for log messages.

You can configure the following log message consumers:

ConsumerTagDescription
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.