Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/liangjfblue/gglog
a useful log, depend on glog
https://github.com/liangjfblue/gglog
aliyun-log glog golang kafka
Last synced: 23 days ago
JSON representation
a useful log, depend on glog
- Host: GitHub
- URL: https://github.com/liangjfblue/gglog
- Owner: liangjfblue
- Created: 2020-03-11T10:25:13.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-05-13T10:30:30.000Z (over 4 years ago)
- Last Synced: 2024-10-30T05:23:56.711Z (2 months ago)
- Topics: aliyun-log, glog, golang, kafka
- Language: Go
- Size: 66.4 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gglog
[![Build Status](https://travis-ci.org/liangjfblue/gglog.svg?branch=master)](https://travis-ci.org/github/liangjfblue/gglog)
English | [įŽäŊä¸æ](README_ZH.MD)
đA lightweight log library, including local logs, kafka logs, Alibaba Cloud logs...
Of course, plug-in access to the log library you want## demo
you can see the demo in gglog_test.go## feature
- Pluggable
- Concurrent security
- lightweight## use step
### local log
- 1.NewGGLog()
- 2.Init()
- 3.FlushLog() //or you can set the config param FlushInterval to control flush the log to file### kafka log
- 1.NewGGLog()
- 2.Init()
- 3.Run()### aliyun log
- 1.NewGGLog()
- 2.Init()
- 3.Run()You can also use your own log library by implementing the Log interface
## log format
### log local
> [date time][code line][level]:msg[2020-03-11 17:19:22][testing.go:909][INFO]: info...
[2020-03-11 17:31:42][testing.go:909][INFO]: info...
[2020-03-11 17:53:59][testing.go:909][INFO]: info...
[2020-03-11 18:01:35][testing.go:909][INFO]: info...### kafka log
> [ip][code line][date time][level][desc][hostname]{"ip":"127.0.0.1", "location":"gglog.go:53", "tm":1589254203824, "level":"info", "desc":"I...", "hostname":"DESKTOP-7LEL6NV"}
{"ip":"127.0.0.1", "location":"gglog.go:63", "tm":1589254203824, "level":"warn", "desc":"W...", "hostname":"DESKTOP-7LEL6NV"}
{"ip":"127.0.0.1", "location":"gglog.go:73", "tm":1589254203824, "level":"error", "desc":"E...", "hostname":"DESKTOP-7LEL6NV"}### aliyun log
> [ip][code line][date time][level][desc][hostname]{"ip":"127.0.0.1", "location":"gglog.go:53", "tm":1589254203824, "level":"info", "desc":"I...", "hostname":"DESKTOP-7LEL6NV"}
{"ip":"127.0.0.1", "location":"gglog.go:63", "tm":1589254203824, "level":"warn", "desc":"W...", "hostname":"DESKTOP-7LEL6NV"}
{"ip":"127.0.0.1", "location":"gglog.go:73", "tm":1589254203824, "level":"error", "desc":"E...", "hostname":"DESKTOP-7LEL6NV"}