Log class
The Log class is an Itential Platform class used to output errors, warnings, and other information to the console or the Itential Platform log files.
Access the log object
Itential Platform instantiates the Log class on startup and exposes it as the global log object. Applications and adapters may reference it directly.
Example cog file
Log levels
Log levels control the amount of information recorded. Each level has an associated severity. The following levels are available:
console.log is not supported by Itential Platform. Use the Log class instead.
Log levels are defined in the loggerProps object of the Itential Platform Profile, configurable within the Admin Essentials application.
- The
log_levelproperty determines the level for the log file. - The
console_levelproperty determines the level for the console. - In the example below,
log_levelis set toinfo, which means any logging atinfoseverity or higher will be written to the log file (info,warn,error,debug,console,trace). - If
log_levelweredebug, Itential Platform would log alllog.debugmessages from cogs and adapters.
Properties file
The following is an example of the loggerProps object in an Itential Platform Profile: