ThingWorx WebSocket-based Edge MicroServer (WS EMS) and Lua Script Resource (LSR) > REST Web Services Supported by WS EMS > StartFileLogging
The StartFileLogging service tells the WS EMS to begin writing log messages to a file. The WS EMS generates log messages at the level defined by a call to this service.
You pass in TW_INFOTABLE that has one row and two columns. The row object must contain the following parameters:
The level of the log messages to write to a file. Choose among the following levels: TRACE, DEBUG, WARN, INFO, or AUDIT, where TRACE provides the most information.
directory, which specifies the path to the file on the computer where the WS EMS is running. Use the following format: /twx/wsems/logfiles/directory.
The TRACE level is useful when testing and troubleshooting. It provides both the operational and functional log messages for a WS EMS.
This service returns an HTTP response only. If the operation was successful, it returns HTTP 200. Otherwise, it returns an HTTP error.
Here is an example of a REST call that tells a WS EMS to start logging messages that it generates to a file, with the log level set to TRACE: