Repository navigation
Releases
Releases · takattila/graylogger
Added MIT License
Initialized package
Logging levels
- Debug : designates fine-grained informational events that are most useful to debug an application.
- Info : designates informational messages that highlight the progress of the application at coarse-grained level.
- Warning : designates potentially harmful situations.
- Error : designates error events that might still allow the application to continue running.
- Fatal : designates very severe error events that will presumably lead the application to abort.
Initialization
g := graylogger.New(graylogger.Init{
// Optional fields for sending GELF messages to Graylog.
GraylogHost: "localhost",
GraylogPort: 12201,
GraylogProtocol: graylogger.TransportUDP,
GraylogProvider: "ExampleService",
// Obligatory fields.
LogEnv: "test",
LogLevel: graylogger.LevelDebug,
LogColor: true,
})
g.Debug("example", "debug message")
g.Info("example", "info message")
g.Warning("example", "warning message")
g.Error("example", "error message")