1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-05-19 21:23:04 +02:00
Johnson C af3cfa0a4c
remove unnecessary dependencies between plugins
remove unnecessary dependencies between plugins
upgrade go-micro.dev/v4 to v4.2.1
2021-10-23 16:20:42 +08:00
..
2021-10-13 13:31:23 +01:00
2021-10-12 12:55:53 +01:00
2021-06-20 09:28:30 +01:00
2021-10-12 12:55:53 +01:00

WindowsEventLog

windows event log implementation for go-micro meta logger.

Usage

Before the first use, it is necessary to initialize the registrar with administrator rights.

The NewLogger function tries to create an event source named src in the options (or by default), but this may not happen, so for proper initialization it is recommended to use the Init function, which returns an error.

func Init() {
  l := windowseventlog.NewLogger(windowseventlog.WithSrc("test src"), logger.WithEid(1000))
  err := l.Init()
  if err != nil {
      //smt
  }
}
func Example() {
  logger.DefaultLogger = windowseventlog.NewLogger(windowseventlog.WithSrc("test src"), logger.WithEid(1000))

  logger.Infof(logger.InfoLevel, "testing: %s", "Infof")

}