Skip to content

Releases

Added MIT License

Choose a tag to compare

@takattila takattila released this 11 May 14:43
e9a27a8
Merge pull request #1 from takattila/add-license-1

Create LICENSE

Initialized package

Choose a tag to compare

@takattila takattila released this 27 Jan 21:08

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")
⌂ 换网址