IBM Worklight 6.0 - 如何在适配器中启用/查看WL.Logger.debug? [英] IBM Worklight 6.0 - How to enable/view WL.Logger.debug in adapters?

查看:133
本文介绍了IBM Worklight 6.0 - 如何在适配器中启用/查看WL.Logger.debug?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经实现了以下简单的HTTP适配器,以便将自己介绍给Worklight Adapters。它工作正常。

I have implemented the following simple HTTP adapter in order to introduce myself to Worklight Adapters. It works correctly.

但是,我无法在Eclipse Worklight控制台中看到我的 WL.logger.debug 语句!

However, I can't see in the Eclipse Worklight console my WL.logger.debug statements!

我试图配置logging.properties和server.xml,如图所示中的/wrklight/v6r0m0/index.jsp?topic=/com.ibm.worklight.help.doc/monitor/c_configure_logging_dev_server.html\"rel =nofollow>,但未显示调试行(请求和结果)。

I've tried to configure logging.properties and server.xml as shown in this Information Center article, but it doesn't show the debug lines (request and result).

有什么建议吗?

JS:

 function currencyConvertor(data) {

            var request =
                <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema- instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
                      <soap:Body>
                       <ConversionRate xmlns="http://www.webserviceX.NET/">
                          <FromCurrency>{data.fromCurrency}</FromCurrency>
                          <ToCurrency>{data.toCurrency}</ToCurrency>
                        </ConversionRate>
                       </soap:Body>
                 </soap:Envelope>;

                 WL.Logger.debug("request start ---------");
                     WL.Logger.debug(request); 
                     WL.Logger.debug("request end --------");

                 var input = {
                               method : 'post',
                               returnedContentType : 'xml',
                               path : '/CurrencyConvertor.asmx',
                               body: {
                                       content: request.toString(),
                                       contentType: 'text/xml; charset=utf-8'
                                      }
                              };

                 var result = WL.Server.invokeHttp(input);

                 WL.Logger.debug("result start ---------");
                     WL.Logger.debug(result); 
                     WL.Logger.debug("result end --------");

                 return result.Envelope.Body;
        }


推荐答案

WebSphere Liberty配置文件不支持Worklight Development Server控制台视图中的调试级别日志记录。

WebSphere Liberty profile does not support debug level logging in the Worklight Development Server Console view.

您可以使用 WL.Logger.debug 并编辑 server.xml 以查看 trace.log 文件中的日志

You can use WL.Logger.debug and edit server.xml to view the log in the trace.log file


  1. 在Eclipse中打开Servers视图

  2. 扩展Worklight Development Server条目

  3. 双击on Server Configuration(server.xml)

  4. 切换到源选项卡

  5. 取消注释此行:< logging traceSpecification = com.worklight。* = debug = enabled/>

  6. 调用适配器程序后,您将在< eclipseWorkspace> \ WorklightServerConfig \servers\worklight\logs\trace.log

  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确保在尝试查看日志之前重新部署适配器。

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

Alternat ively,

您可以使用 WL.Logger.warn WL.Logger.error ;这些日志显示在Worklight Development Server控制台视图中。

Alternatively,
You can use WL.Logger.warn or WL.Logger.error; these logs will display in the Worklight Development Server Console view.

这篇关于IBM Worklight 6.0 - 如何在适配器中启用/查看WL.Logger.debug?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆