Cis*_*sco 2 logging worklight-adapters ibm-mobilefirst
我已经实现了以下简单的HTTP适配器,以便将自己介绍给Worklight Adapters.它工作正常.
但是,我无法在Eclipse Worklight控制台中看到我的WL.logger.debug陈述!
我已尝试配置logging.properties和server.xml,如本信息中心文章中所示,但它不显示调试行(请求和结果).
有什么建议?
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;
}
Run Code Online (Sandbox Code Playgroud)
WebSphere Liberty概要文件不支持Worklight Development Server Console视图中的调试级别日志记录.
您可以使用WL.Logger.debug和编辑server.xml来查看trace.log文件中的日志
<logging traceSpecification="com.worklight.*=debug=enabled"/><eclipseWorkspace>\WorklightServerConfig\servers\worklight\logs\trace.log在尝试查看日志之前,请务必重新部署适配器.
或者,
您可以使用WL.Logger.warn或WL.Logger.error; 这些日志将显示在Worklight Development Server Console视图中.