| We have an environment where we run simultaneous bolt processes (plans in this case) in separate sessions on a single server. Each of these sessions is referencing the same bolt.yaml file and hence they all write to the same log files. Console output goes to the separate session and contains the results we are after. This data is formatted as json, and directed to a file which we do further processing with. What this means is that all the log data that may be needed for analysis if there are problems goes to the one file making debbugging harder. A lot of the log data doesn't contain anything we can use to determine what session it belongs to. An example of an entry that we can correlate to a specific session is
2020-01-21T18:50:43.181001 INFO Bolt::Executor: Running command 'hostname' on ["server.domain"]
since we know which session server.domain belongs to. An example of a line that doesn't allow us to work out which session it belongs to is:
2020-01-21T17:23:39.741178 INFO Bolt::Outputter::Logger: Finished: command 'hostname' with 0 failures in 22.48 sec
If all the sessions run the hostname command at the same time we can't correlate which finished message belongs with which session. What we'd like to be able to do is have all the output continue to go to the logs configured in bolt.yaml as well being able to provide an addition log entry via the bolt command line which only gets log entries for that bolt run. To allow results from multiple bolt runs to go to the same additional file (for example dev or prod targets) it would be good to allow appending the data if the file already exists. It'd probably be handy to be able to set the log level as well which may be different to using --debug on the command line which sends debug data to the central log. Perhaps use the same defaults as the [log file configuration options|https://puppet.com/docs/bolt/latest/bolt_configuration_options.html#log-file-configuration-options] I expect the command line to be something like:
bolt <subcommand> <action> [params] --logfile session.log --loglevel info --logappend true [--debug]
|