Logging Trace
If you are using a dedicated device cloud running in your AWS account, Ioto provides a convenience wrapper to make uploading log files to AWS CloudWatch logs easier.
The purpose of the error log is to record essential configuration and error conditions. Per-request log typically is sent to a separate log.
The default log file captures log messages issued throughout the various Ioto modules and writes them to the default log file. Log typically is enabled in both debug and release builds and may be controlled via the build compile define ME_R_LOGGING which is typically set to true.
Log messages should be a single text line to facilitate machine processing of log files.
API Tour
To write an informational log message to the error log file.
The Ioto runtime defines four convenience routines for logging:
The convenience routines wrap rlog() and supply the first argument which is the message type. You can create custom types just by using them with rlog(). These standard types are provided: debug, error, fatal, info and trace.
The debug type is for trace trace that should only be emitted in debug builds. The fatal type will cause Ioto to immediately exit. Trace is for more verbose messages that are not emitted by default in production builds but can be enabled at runtime.
Changing Levels
To change which messages are emitted by Ioto, you can define the log filters via the Ioto command line and via the rSetLog API.
To change the default Ioto log trace settings, customize the ioto.json5 trace property:
See the Trace Configuration for details.
You can also change trace levels via the command line. This will override the ioto.json5 trace settings. See the Ioto Trace Command Line for information.
Via the API, you can override log settings:
This will direct log output to newlog.out for all types and all sources.
Log Handlers
You can also override Ioto's log handling and define your own log handler routine that will be invoked to process log messages.
This routine will be invoked for all log messages with the type, source and message parameters.
API Reference
The full API is specified here: