Troubleshooting
Logging
Logging is the most important tool for troubleshooting issues when using the OrgFlow CLI. To enable logging, you can use the following two options with any command:
--logTo=<filePath>
If specified, a log file is written to the specified path.
--logLevel=[Verbose|Debug|Information|Warning|Error|Fatal]
The minimum log level to be written to the log file; logs below this level will not be written. The default log level if not specified is
Information
.
When logging is enabled, a log file with the detail level you specify in the --logLevel
option is written to disk while the command executes. If the file already exists, new log data is appended to the end of the existing file.
Tokens in log file paths
The --logTo=<filePath>
option can be used with any command to have the OrgFlow CLI write logs to a file on disk. When specifying this option, the file path can contain one or more tokens. The following tokens are available:
Token | Result |
---|---|
{C} or {command} | Name of command being executed, e.g. env:flowin |
{T:format} or {time:format} | UTC date and time of current command invocation (see below) |
{U} or {user} | Current local username |
{M} or {machine} | Name of local machine/computer |
The same token can be specified more than once if needed.
Tokens can be very useful when you want to vary the log file location and/or name based on things that vary, without having to specify a different value each time. This is most useful when specifying the log file path as a user setting or an environment variable, rather than directly as a command option.
The {T}
/{time}
token needs to be specified with a format string that controls how the date is formatted into the log file path. Any standard or custom .NET DateTime format string is supported. Date and time formatting is performed using the current system locale. For more information, see:
For example, the following --logTo
option:
--logTo=/orgflow/{user}/logs/{time:yyyy-MM-dd}/{command}-{time:HHmm}.log
would make the OrgFlow CLI log to a file path similar to:
/orgflow/richard/logs/2021-10-06/env-flowin-1648.log