Skip to content

Configuration Properties

ingest

Name ingest
Description Define the list of log files to ingest and send to CloudWatch logs.
Synopsis ingest: { path: "filename", group: "log-group', stream: "log-stream" }
Notes The files property contains one or more file definitions to ingest and send to CloudWatch logs. The definitions define the log file name, AWS CloudWatch log group and stream names.

The path property may contain wild cards and all matching files will be ingested.

The group property specifies the AWS log group name which must exist.

The stream property specifies the AWS log stream name which must exist.

The group and stream properties may contain tokens that are expanded before use. The supported tokens are: "{hostname}" which translates to the system hostname, "{instance}" which expands to the AWS EC2 instance name and "{deviceId}" which expands to the provisioned device.id property.
Example
1
2
3
4
5
files: [ {
    path: '/var/log/sys*log',
    group: 'ioto',
    stream: '{hostname}'
} ],

limits

Name limits
Description Define execution limits for Ioto.
Synopsis limits: { "key": "value", ... }
Notes The limits property collection defines various execution limits for Ioto.

Example

1
2
3
limits: {
    stack: '16K',
},

limits.stack

Name limits.stack
Description Define the stack size of fiber coroutines for Ioto.
Synopsis limits: { stack: "Number" }
Notes The limits.stack property specifies the stack size for Ioto coroutines. This should be set to the maximum anticipated stack size for your executing code. Supplied Ioto code requires a stack size of 12K minimum.

It is recommended that you minimize your use of big stack buffer variables and your use of deep recursion both of which require much bigger fiber stacks.

Example

1
2
3
limits: {
    stack: '16K',
},

log

Name log
Description Control the Ioto log file.
Synopsis log: { path: 'path', format: 'format', types: 'types', sources: 'sources' }
Notes The log property collection defines how and where Ioto logs execution information and trace.

The log.path property specifies the destination of the Ioto log. Set it to "stdout" or "stderr", "aws" or a filename. If set to "aws", then the log.group property specifies the AWS log group name and the log.stream property specifies the AWS log stream name.

The format specifies a leading format for the message that contains printf style tokens that are expanded at runtime. The supported tokens are: 'A' for the application name, 'D' for the local datetime, 'H' for the system hostname, 'M' for the log message, 'P' for the process ID , 'S' for the message source, and 'T' for the log message type.

The types property specifies the types of log messages to emit. It may contain the following types: debug, error, info and trace. It may be set to "all" for all types.

The sources property specifies a comma separated list of log message sources to emit. Sources may be prefixed with "!" to subtract from the list. For example: "all,!mbedtls" will emit log messages from all sources except "mbedtls".

Example

1
2
3
4
5
6
log: {
    path: '/var/log/ioto.log',
    format: '%D %H %A[%P] %T %S %M',
    types: 'error,info',
    sources: 'all'
}

profile

Name profile
Description Configuration profile to select.
Synopsis profile: "dev | qa | prod | ..."
Notes The profile property is used to select different configurations for Ioto at runtime. For example, it can select a "dev" profile for development and a "prod" profile for productions.

The profile property selects a set of configuration properties from the profiles. These are copied to the top level and overwrite any existing top-level properties.

Example

profile: "prod"

profiles

Name profiles
Description Configuration profiles and their configuration.
Synopsis profiles: { "Profile-Name": { /* properties */ }
Notes The profile property is used to select different configurations for Ioto at runtime. For example, it can select a "dev" profile for development and a "prod" profile for productions.

The profile property selects a set of configuration properties from the profiles. These are copied to the top level and overwrite any existing top-level properties.

Example

profiles: {
    prod: {
        ingest: {
            files: [
                {path: '/var/log/sys*log', group: 'ioto', stream: '{hostname}' }
            ]
        }
    },
    dev: {
        ingest: {
            files: [],
        }
    }
}

services

Name services
Description Configure which Ioto services to enable at runtime.
Synopsis services: { 'Service-Name': true | false, ... }
Notes The services property collection defines which Ioto services to enable.

The supported services are:
  • aws — AWS IoT Core messaging
  • extend — User extensions in extend.c
  • logs — Send local log files to CloudWatch logs
  • mqtt — MQTT services
  • shadow — AWS IoT device shadows
  • state — Send device state to AWS database
  • web — Local web server
Some services depend on others. Lower-level services will be forcibly enabled if upper level services require them. For example: mqtt will be enabled if aws is enabled.

The following dependencies are observed:
  • aws — depends on mqtt
  • shadow — depends on aws
  • state — depends on aws

Example

1
2
3
4
5
6
7
8
9
services: {
    core: true,
    extend: true,
    logs: true,
    mqtt: true,
    shadow: true,
    state: true,
    web: true,
},