Use Logs

This topic summarizes how to use Legato logging.

There's also some background info.

Legato creates log messages in LE_INFO() by default Only minimal info is reported, and only for the current app: essentially logs if the app is communicating. You need to modify default settings to enable monitoring for anything else.

There are two built-in features to control logging using the Logging Tool or Logging API. There are also App Crash Logs.

Access Logs

Run logread on the target to view the system log.

Run logread -f to start monitoring the logs and display messages as they are logged.

The installed app's output LE_INFO() log message will appear in the target's system log (syslog).

Logging Tool

The target log tool is the easiest way to set logging controls. You can control what's being logged, filter levels, trace keywords, and processes all through the command-line in a running system.

Run log level INFO "processName/componentName" to set the log level to INFO for the specified component in a process.

Run log trace "keyword" "processName/componentName" to use a keyword trace.

See log for details.

Default syslog

By default, app processes will have their stdout and stderr redirected to the syslog. Each process’s stdout will be logged at INFO severity level; it’s stderr will be logged at “ERR” severity level.

See Standard Out and Standard Error in Syslog for more info.

Logging API

The Logging API provides a toolkit to set error, warning, info, and debugging messages with macros and condition support including default environment variable controls that can be output to different devices and formats.

See Logging API for details.

Copyright (C) Sierra Wireless Inc. Use of this work is subject to license.