ThingWorx WebSocket-based Edge MicroServer (WS EMS) and Lua Script Resource (LSR) > Configuring a Lua Script Resource > Configuring the Logger for the LSR
  
Configuring the Logger for the LSR
As of version 5.4.0, the Lua Script Resource provides the same logging configuration properties as the WS EMS.
The scripts.log_level group (see the config.lua example configuration file) is used to configure the Lua Script Resource to collect logging information.
scripts.log_level = "INFO"
scripts.log_audit_target = "file:// or http:// "
scripts.log_publish_directory = "/_tw_logs/"
scripts.log_publish_level = "WARN"
scripts.log_max_file_storage = "2000000"
scripts.log_auto_flush = "true"
scripts.log_flush_chunk_size = "16384"
scripts.log_buffer_size = "4096"
Logging Properties
The following table lists and describes the properties of the logger element:
Property
Description
scripts.log_level
The level of information that you want to include in the audit log file. Valid values include:
FORCE
ERROR
WARN
INFO (the default value)
DEBUG
TRACE
* 
When troubleshooting a problem, set the level to TRACE so that you can see all the activity. For production, set the level to ERROR if you want to see error messages.
scripts.log_audit_target
The path to the audit log file where audit events will be written. Alternatively, specify an HTTP address for the audit log file, where these events will be sent using a POST command.
Audit events are also written to the normal log destination . If no target is specified, no additional auditing takes place.
Valid values include:
file://path_to_file
http://hosted_location
scripts.log_publish_directory
A location for writing to log files those log events that meet or exceed the publish_level. .
* 
sThe LSR and WS EMS use the same naming scheme for log files. Specify a directory that is different from the one specified in the publish_directory property in the config.json file of the WS EMS.
scripts.log_publish_level
The level of information that you want to include in the alternate log files. Valid values include:
AUDIT
ERROR
WARN
INFO
DEBUG
TRACE
scripts.log_max_file_storage
The maximum amount of space that log files can take up, in bytes. Keep in mind that there are two concurrent log files. The maximum size of each individual log file is max_file_storage divided by 2. The default value is 2000000 bytes (2MB).
scripts.log_auto_flush
Whether the LSR should flush every N bytes to the publish_directory. The N is defined by flush_chunk_size. The LSR also flushes the buffer if a message has not been written to the log in the last second.
A setting of true forces the LSR to flush every N bytes.
scripts.log_flush_chunk_size
The number of bytes to write before flushing to disk. The default setting is 16384 bytes.
scripts.log_buffer_size
The maximum number of bytes that can be printed in a single logging message. The default setting is 4096 bytes.