+

Search Tips   |   Advanced Search

Configure logging in the development server

Information about the default logging settings for the embedded development server, and procedures for changing them.

When we are trying to diagnose problems in the MobileFirst Studio embedded test server (for example, when debugging a custom login module), it is important to be able to see log messages. The default settings for server logging are described in this section, along with the procedures for changing them if we must see finer levels of messages.

In previous releases of MobileFirst Studio, the embedded Jetty test server did not allow viewing the server logs. In Worklight Studio v6.0.0, the test server was replaced with an instance of the WAS Liberty profile server and is now referred to as the MobileFirst Development Server.

Logging levels for the MobileFirst Studio plugin and builder can be configured with a new file named logging.properties. This file is in the .metadata folder of your Eclipse workspace.

For example, if the MobileFirst Studio workspace is /usr/workspace (on UNIX) or C:\workspace (on Windows), the corresponding logging configuration file is /usr/workspace/.metadata/logging.properties or C:\workspace\.metadata\logging.properties.

This file contains the following default settings:

handlers = java.util.logging.FileHandler
.level = WARNING
com.worklight.level = INFO


Change the operations console logging levels

To change the logging level for all packages in this instance of Eclipse, edit the .level = line. To change the logging level only for MobileFirst Studio, edit the com.worklight.level = line.

The available setting levels for com.worklight.level = are:

In addition, there is an ALL level that specifies logging of all messages, and an OFF level that turns off logging.

If we edit the logging.properties file to change the logging level, we must restart MobileFirst Studio before the change takes effect.

Whatever the logging level, the messages are displayed in MobileFirst Studio in its console view with the name MobileFirst Console, as shown in the following screen capture:


Change the logging levels of a web application in Liberty profile

Change the logging properties for individual application server types is done with those servers' administration tools.

To provide two examples for WAS Liberty profile, the server.xml file can be modified by appending the new logging element:

The available setting levels for consoleLogLevel are:

This parameter does not support DEBUG level logging.

No server restart is necessary after you modify these settings.

Whatever the logging level, the messages are displayed in MobileFirst Studio in its console view with the name MobileFirst Development Server, as shown in the following screen capture:

This console view allows you to see messages from the MobileFirst Development Server, but with some known limitations:

Trace log messages are written to the trace.log file only. This logging trace is optional and supports fine-tuning such as packaging and more precise reporting levels, and is mainly used for debugging.

The trace*.log file is found under the Eclipse workspace in the folder WorklightServerConfig\servers\worklight\logs\.

For example, if the MobileFirst Studio workspace is /usr/workspace (on UNIX) or C:\workspace (on Windows), the log files are created under /usr/workspace/WorklightServerConfig/servers/worklight/logs/ or C:\workspace\WorklightServerConfig\servers\worklight\logs\.

The available setting levels for <logging traceSpecification="*=audit=enabled:com.worklight.*=info=enabled" /> are:

For more information about WAS Liberty profile logging configuration, see Liberty profile: Trace and logging.


Parent topic: Logging and monitoring mechanisms