Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(addr, appName, env, version string) (io.WriteCloser, error)
New creates a new io.WriteCloser that sends logs to a GELF server at the given address.
func NewWithPassthrough ¶
func NewWithPassthrough(addr, appName, env, version string, passthrough io.Writer) (io.WriteCloser, error)
NewWithPassthrough creates a new io.WriteCloser that sends logs to a GELF server at the given address and also writes the logs to the given passthrough writer.
This is useful for debugging, as it allows you to see the logs that are being sent to the GELF server. If you don't need this, use New instead.
example:
w, err := NewWithPassthrough("localhost:12201", "myapp", "dev", "1.0.0", os.Stdout)
if err != nil {
...
}
OR
w, err := NewWithPassthrough("localhost", "myapp", "dev", "1.0.0", zerolog.ConsoleWriter{Out: os.Stdout}))
if err != nil {
...
}
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.