Recover from any possible io error when invoking Write on FileRotator
Recover from any possible io error when invoking Write on FileRotator

As of now, FileRotator uses bufio.Write under the hood to write data to
configured output file. Due to the way how bufio handles any occurred io
error - saves it into `err` variable never resetting it automatically -
any operation like `Write`, `Flush` etc will become a no-op, returning the very same,
saved error (eg. Out of disk space) even when the problem is fixed (eg. disk
space is available again).

That automatically means that FileRotator will stop writing any logs,
reporting the same error over and over again, even if it's no longer
valid.

This PR fixes it by resetting the bufio Writer, which resets any errors
and tries to write requested data.

dvusboy/nomad,dvusboy/nomad,burdandrei/nomad,burdandrei/nomad,hashicorp/nomad,hashicorp/nomad,dvusboy/nomad,hashicorp/nomad,burdandrei/nomad,burdandrei/nomad,dvusboy/nomad,dvusboy/nomad,hashicorp/nomad,hashicorp/nomad,dvusboy/nomad,hashicorp/nomad,burdandrei/nomad,burdandrei/nomad,dvusboy/nomad,burdandrei/nomad