Flowee the Hub documentation
Configuration: logs.conf
Logging configuration is needed when some part of the software needs to be more loud (or quiet) than the default.
The logs are configured in the logs.conf
configure file, typically
stored in /etc/flowee/logs.conf when you run from systemd. The format of
this file is explained here.
Example file:
channel console
option timestamp time millisecond
channel file
option timestamp time
2004 info # NWM
channels
There are two types of channels console
and file
. Each can
receive a number of different options.
channel console
option timestamp time
channel file
option timestamp time millisecond
option path /var/log/flowee/
The usage of the ‘channel’ keyword implies you enable that channel, if you have no channels your logs will go nowhere!
You can configure each channel with a number of options. In the example the console will not have any timestamps, while the file output will list time without dates, showing millisecond if needed.
The options are:
- option timestamp
- Configure timestamps. The arguments are any combination of
date
,time
andmillisecond
. No argument means you turn off timestamps.
Default istime millisecond
for the console channel, the file channel defaults todate time millisecond
. - option path [filepath]
- This allows configuration of the file that the log goes to. Only used by
the file channel.
Default: [datadir]/hub.log - option linenumber true
- Development builds only.
Prefix output with the linenumber of the source file. This only works for debug builds as other builds do not embed this info.
Default: off - option methodname true
- Development builds only.
Prefix output with the methodname. This only works for debug builds as other builds do not embed this info.
Default: true - option filename true
- Development builds only.
Prefix output with the filename of the source file. This only works for debug builds as other builds do not embed this info.
Default: false
Where to place the logs.conf
Because the logs.conf can specify the actual location for the logging file the hub will use a config that is specific to a certain datadir first. This allows a different setup of hub to end up logging to a different file. Check the file channel details above, specifically the path option that can follow a file channel.
The logs conf is searched in order, following the table below, the first that is found will be the one used.
- Effective datadir.
This is the subdirectory under the general datadir with the chain that is being followed. For instance ’testnet4’. Notice that for mainchain this step is skipped. - Datadir.
The main datadir. - If -conf is given to point to the hub config file, we try to find the logs.conf in the same directory.
- The $XDG_CONFIG_HOME directory, if avaialble.
This follows the opendesktop specification, on supported platforms. - The user’s config directory for Flowee:
$HOME/.config/flowee/
Log sections and levels
It is possible to specify a per-section log-level. Default log-level is “WARNING”.
Example:
ALL quiet
1001 silent
Log sections are numbered and fully documented in their own page.
Log levels are named, full details in their own page.
For convenience of configuration the sections are sub-divided into groups. Each group being a multiple of 1000.
2000 info # networking
2001 silent
In the above example we set the group networking to show all messages. Because this is a group this will affect all network sections. 2000 - 2999. You can still override individual sections afterwards.
Reloading of config file
On Unix systems you can change the logs.conf file and then send the unix signal SIGHUP
to trigger the re-parsing of the configuration file.
This signal will also cause the log file to be closed and re-opened, which is useful for log-rotation.