metaapi.cloud-sdk
Version:
SDK for MetaApi, a professional cloud forex API which includes MetaTrader REST API and MetaTrader websocket API. Supports both MetaTrader 5 (MT5) and MetaTrader 4 (MT4). CopyFactory copy trading API included. (https://metaapi.cloud)
13 lines (8 loc) • 617 B
Markdown
## Enable log4js logging
By default SDK logs messages to console. You can select the SDK to use [log4js](https://www.npmjs.com/package/log4js) logging library by calling `MetaApi.enableLog4jsLogging()` static method before creating MetaApi instances.
```javascript
import MetaApi from 'metaapi.cloud-sdk';
MetaApi.enableLog4jsLogging();
const metaApi = new MetaApi(token);
```
Please note that the SDK does not configure log4js automatically. If you decide to use log4js, then your application is still responsible to configuring log4js appenders and categories. Please refer to log4js documentation for details.