Skip to content

When hook is initialised successfully, disable logging to stdout #328

@rogierlommers

Description

@rogierlommers

Most of the time I'm logging to a Redis host, which pipes messages straight to an ELK stack. I'm wondering if it is possible to disable all output to stdout/err at the time a hook is initialised successfully.

For example:

hook, err := logredis.NewHook("localhost", 6379, "my_redis_key", "my_app_name")
if err == nil {
    log.AddHook(hook)
    log.DisableStdOut()
}

So once the hook is in use, disable all output to stdout. Is this possible now?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions