Documentation ¶
Overview ¶
A hook for console.go that send all logs over AMQP (by example to a Scribe.js server)
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AmqpHook ¶
func AmqpHook(options AmqpOptions) (func(logger console.Logger) error, error)
Open amqp connection and return an hook that send log to an AMQP queue
Example ¶
myConsole = console.NewConsole(console.ColorsOptions{}) h, err := scribeHook.AmqpHook(scribeHook.AmqpOptions{ "server": "amqp://localhost", "exchange": "test-notif", "exchangeType": "fanout", "rountingKey": "console", }) if err != nil { fmt.Println(err) } else { myConsole.AddHook(h) }
Output:
Types ¶
type AmqpOptions ¶
Stores amqp options
Example ¶
AmqpOptions{ "server": "amqp://localhost", "rountingKey": "config", "exchange": "test-notif", "exchangeType": "fanout", }
Output:
Click to show internal directories.
Click to hide internal directories.