In order to transition large existing codebases to use end-to-end structured logging, we want to be able to make use of the hclog Logger.StandardWriter. The entails setting the default std library log output to a wrapped instance of an hclog.Logger while running the server.
The plugin.Server function however overrides the log output when initializing the server. This means the implementation currently needs to restore its logger again after the server has started (there is no callback, so this must be checked on the first method call). Failing to do so does not cause an error, however it does cause the log output to lose its structure.
Removing the call to log.SetOutput makes it easier to setup a std library logger for all implementations, at the minor expense of requiring all implementations to ensure they write to os.Stderr, which is almost always the default case.
In order to transition large existing codebases to use end-to-end structured logging, we want to be able to make use of the hclog
Logger.StandardWriter
. The entails setting the default std library log output to a wrapped instance of anhclog.Logger
while running the server.The
plugin.Server
function however overrides the log output when initializing the server. This means the implementation currently needs to restore its logger again after the server has started (there is no callback, so this must be checked on the first method call). Failing to do so does not cause an error, however it does cause the log output to lose its structure.Removing the call to
log.SetOutput
makes it easier to setup a std library logger for all implementations, at the minor expense of requiring all implementations to ensure they write toos.Stderr
, which is almost always the default case.Fixes #155