Logging in JavaScript Adapters
Overview
This tutorial provides the required code snippets in order to add logging capabilities in a JavaScript adapter.
Logging example
The message below outputs to the trace.log
file of the application server. If the server administrator is forwarding logs from the PMF to the PMF Analytics Server the logger
message will also appear in the Infrastructure → Server Log Search view in the PMF Analytics Console.
MFP.Logger.debug("This is a debug message from a JavaScript adapter");
Additional logging levels, from least to most verbose: ERROR, WARN, INFO, LOG and DEBUG.
Accessing the log files
- In an on-prem installation of the PMF, the file is available depending on the underlying application server.
Forwarding Logs to the Analytics server
Logs can also be forwarded to the Analytics console.
- In PMF Operations Console select the Settings option from the sidebar navigation.
- Click the Edit button in the Runtime Properties tab.
- In the Analytics → Additional packages section, specify MFP.Logger to forward JavaScript Adapter logs to the PMF.
Last modified on