0

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())?

Idan Adar
  • 44,156
  • 13
  • 50
  • 89
Daniel Yang
  • 276
  • 2
  • 11

1 Answers1

1

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.

Community
  • 1
  • 1
Idan Adar
  • 44,156
  • 13
  • 50
  • 89
  • Thanks, the answer is fine, with inexact search keyword, I didn't get the referenced question, I'm sorry about adding a new question for same case, I'd like to remove current question, but I'm not sure how to remove it. And I'm doubting about why in Eclipse Progress View after starts the server 'Configuring server for project xxx' takes too long after enabled tracing setting with above setting. – Daniel Yang Sep 29 '14 at 03:16
  • No need to remove; questions can be marked as duplicates. You can mark this answer as one that resolved your issue. :-) (see the 'v' checkmark next to the vote buttons on the left. – Idan Adar Sep 29 '14 at 03:17