Daniel Yang
Daniel Yang

Reputation: 298

Worklight 6.2 WL.Logger.debug cannot capture messages

With Worklight 6.2 developer edition, I use the following 4 statements in an adapter, however in server.xml there is only a single "logging" property; as consequence, the 'Worklight Deployment Server' console cannot capture all of these messages:

WL.Logger.info("i");
WL.Logger.warn("w");
WL.Logger.error("e");
WL.Logger.debug("d");

sample line in server.xml:

<logging consoleLogLevel="INFO" copySystemStreams="true"/>

i.e.

set level to 'INFO',    it captures 3 messages: i, w, e. 
set level to 'AUDIT',   it captures 2 messages: w, e. 
set level to 'WARNING', it captures 2 messages: w, e. 
set level to 'ERROR',   it captures 1 messages: e. 

What I'd like to know is how can I capture messages given by WL.Logger.debug() or must I change it to other methods (i.e. warn(), info())?

Upvotes: 0

Views: 736

Answers (1)

Idan Adar
Idan Adar

Reputation: 44516

See this question: IBM Worklight 6.0 - How to enable/view WL.Logger.debug in adapters?


The Websphere Liberty profile console does not support debug level.

However, you can still use it and in order to see the log line, you'll need to enable trace in Liberty and then find the trace.log file, where you will see the debug-level log line. For more information you can read the following documentation topic: Liberty profile - logging and trace.

Steps you can follow to achieve the above: You can use WL.Logger.debug and edit server.xml to view the log in the trace.log file

  1. Open the Servers view in Eclipse
  2. Expend the Worklight Development Server entry
  3. Double-click on Server Configuration (server.xml)
  4. Switch to Source tab
  5. Uncomment this line: <logging traceSpecification="com.worklight.*=debug=enabled"/>
  6. After invoking your adapter procedure you will find the log at <eclipseWorkspace>\WorklightServerConfig\servers\worklight\logs\trace.log

Be sure to re-deploy the adapter before attempting to view the logs.

Upvotes: 1

Related Questions