问题描述
我已经实现了以下简单的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>,但未显示调试行(请求和结果)。
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控制台视图中的调试级别日志记录。
您可以使用 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
- Open the Servers view in Eclipse
- Expend the Worklight Development Server entry
- Double-click on Server Configuration (server.xml)
- Switch to Source tab
- Uncomment this line:
<logging traceSpecification="com.worklight.*=debug=enabled"/>
- 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.
Alternat ively,
您可以使用 WL.Logger.warn
或 WL.Logger.error
;这些日志将显示在Worklight Development Server控制台视图中。
这篇关于IBM Worklight 6.0 - 如何在适配器中启用/查看WL.Logger.debug?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!