onrik / logrus

Hooks for logrus logging
MIT License
122 stars 30 forks source link

Added Flush method send all events before app is exited #18

Closed smurfpandey closed 4 years ago

smurfpandey commented 4 years ago

In my application errors were not getting reported. After calling flush method it started to work.

onrik commented 4 years ago

Nice idea. Please move timeout to Hook struct.

smurfpandey commented 4 years ago

Timeout is only needed for flush method. And if we move the timeout to struct, when will the user provide it's value?

onrik commented 4 years ago
func (hook *Hook) SetFlushTimeout(timeout time.Duration) {
    hook.flushTimeout = timeout
}