logmon: log stat error to help debugging
This commit is contained in:
parent
6301725002
commit
1851820f20
|
@ -204,7 +204,8 @@ func newLogRotatorWrapper(path string, logger hclog.Logger, rotator io.WriteClos
|
|||
var openFn func() (io.ReadCloser, error)
|
||||
var err error
|
||||
|
||||
if _, ferr := os.Stat(path); os.IsNotExist(ferr) {
|
||||
_, serr := os.Stat(path)
|
||||
if os.IsNotExist(serr) {
|
||||
openFn, err = fifo.CreateAndRead(path)
|
||||
} else {
|
||||
openFn = func() (io.ReadCloser, error) {
|
||||
|
@ -213,6 +214,7 @@ func newLogRotatorWrapper(path string, logger hclog.Logger, rotator io.WriteClos
|
|||
}
|
||||
|
||||
if err != nil {
|
||||
logger.Error("failed to create FIFO", "stat_error", serr, "create_err", err)
|
||||
return nil, fmt.Errorf("failed to create fifo for extracting logs: %v", err)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue