Skip to content

Configuration

François JARRIER-GELLEZ edited this page Jan 19, 2021 · 4 revisions

Location

By default, you can find the configuration file to etc folder, the filename is defined by the daemon which use this library.

The configuration file can be specify in the command line.

Sample of configuration file

[mqtt]
server=tcp://127.0.0.1:1883
id=client_id
topic=main_topic_of_daemon
keepalive=300
timeout=5
qos=0
retained=true

[log]
level=1
destination=cerr
module=
function=

[mqttlog]
enable=true
topic=logger/main_topic_of_daemon
level=1
module=
function=

mqtt section

Specify the mqtt provider.

  • server to define mqtt server url (default tcp://127.0.0.1:1883)
  • id to define a mqtt client id (empty by default)
  • topic specify the topic (default value is defined by the daemon which use this library)
  • keepalive specify keepalive, in second (default 300)
  • timeout specify the timeout, in second (default 5)
  • qos specify the qos (default 0)
  • retained specify the retained option (default true)
  • user specify a user for mqtt authentication
  • password specify a password for mqtt authentication, not use if user is empty

log section

Specify the log file or standard output.

  • level to define log level, 1 to 7 or FATAL|ERROR|WARNING|INFO|VERBOSE|DEBUG|TRACE (default 1)
  • destination to specify log destination cout, cerr, clog or a file (default cerr)
  • module to limit log on a source file
  • function to limit log on a single function

mqttlog section

To send log on mqtt provider.

  • enable set true to activate this functionnality (default false)
  • topic to specify the log topic (default logger/main_topic_of_daemon)
  • level to define log level, 1 to 7 or FATAL|ERROR|WARNING|INFO|VERBOSE|DEBUG|TRACE (default 1)
  • module to limit log on a source file
  • function to limit log on a single function

Comments

To comment a line don't use character # but character ;

Clone this wiki locally