-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Additional delimiter for messages #60
Comments
Hi @eloo 👋, Thanks for your ticket but just a small question: What I mean is why do you need to append Thanks. |
Hi @boaz0, Thanks |
Hi @eloo In order to append characters to the formatted message you can do the following thing:
type SuffixAppender struct {
nextWriter io.Writer
}
func (sa SuffixAppender) Write(dataBytes []byte) (int, error) {
newData := append(dataBytes, []byte("\n")...)
n, err := sa.nextWriter.Write(newData)
return n, err
}
log := logrus.New()
sout := SuffixAppender{nextWriter: os.Stdout}
hook := logrustash.New(sout, logrustash.DefaultFormatter(...)) Does that solve your problem? |
@boaz0 Thanks! |
Thanks @eloo I will add this to the docs and close it once it's merged. Best regards. |
sounds good. |
Hello,
i'm testing your library right now to use it together with a fluentD stack and it looks like we could need an additional delimiter to the fired messages.
So would it be possible to configure an additional delimiter for the hook? For example a nullcharacter?
This could be easily done like this
What do you think about it?
Thanks
eloo
The text was updated successfully, but these errors were encountered: