{"id":15522066,"url":"https://github.com/alexstocks/log4go","last_synced_at":"2025-04-23T04:12:31.394Z","repository":{"id":57482720,"uuid":"155869844","full_name":"AlexStocks/log4go","owner":"AlexStocks","description":"Logging package similar to log4j for the Go programming language","archived":false,"fork":false,"pushed_at":"2020-03-10T11:46:47.000Z","size":1213,"stargazers_count":12,"open_issues_count":1,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-23T04:12:25.894Z","etag":null,"topics":["go","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AlexStocks.png","metadata":{"files":{"readme":"README.md","changelog":"change_log.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-02T13:29:18.000Z","updated_at":"2024-07-07T16:24:50.000Z","dependencies_parsed_at":"2022-09-03T06:24:52.551Z","dependency_job_id":null,"html_url":"https://github.com/AlexStocks/log4go","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexStocks%2Flog4go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexStocks%2Flog4go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexStocks%2Flog4go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexStocks%2Flog4go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlexStocks","download_url":"https://codeload.github.com/AlexStocks/log4go/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250366722,"owners_count":21418772,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang"],"created_at":"2024-10-02T10:39:33.525Z","updated_at":"2025-04-23T04:12:31.361Z","avatar_url":"https://github.com/AlexStocks.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# log4go\n---\n\n[![Build Status](https://travis-ci.org/AlexStocks/log4go.svg?branch=master)](https://travis-ci.org/AlexStocks/log4go)\n[![codecov](https://codecov.io/gh/AlexStocks/log4go/branch/master/graph/badge.svg)](https://codecov.io/gh/AlexStocks/log4go)\n[![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go\u0026logoColor=white\u0026style=flat-square)](https://pkg.go.dev/github.com/AlexStocks/log4go?tab=doc)\n[![Go Report Card](https://goreportcard.com/badge/github.com/alexstocks/log4go)](https://goreportcard.com/report/github.com/alexstocks/log4go)\n![license](https://img.shields.io/badge/license-Apache--2.0-green.svg)\n\nPlease see http://log4go.googlecode.com/ for more log4go usages. My personal\npackage (github.com/AlexStocks/goext/log) wrappered log4go functions further\nmore which provides the most powerful log4go.\n\nInstallation:\n- Run `go get -u -v github.com/AlexStocks/log4go`\n\nUsage:\n\n- Add the following import:\n\n``` Go\n  import l4g \"github.com/AlexStocks/log4go\"\n\n  func main() {\n  \tdefer l4g.Close() // to close l4g.Global\n  }\n```\n\n### get logger\n\n#### Global logger\n\n```go\nimport l4g \"github.com/alecthomas/log4go\"\n\nl4g.Info(\"hello world\")\ndefer l4g.Close()\n```\n\n#### NewDefaultLogger\n\n```go\nlog := l4g.NewDefaultLogger(l4g.INFO)\nlog.Info(\"hello world\")\ndefer log.Close()\n```\n\n#### l4g.Logger\n\n```go\nlog := make(l4g.Logger)\ndefer log.Close()\nlog.AddFilter(\"stdout\", l4g.DEBUG, l4g.NewConsoleLogWriter())\nlog.Info(\"hello world\")\n```\n\n## output log\n\n```go\nl4g.Finest()\nl4g.Fine()\nl4g.Debug()\nl4g.Trace()\nl4g.Info()\nl4g.Warning()\nl4g.Error()\nl4g.Critical()\n```\n\n## UserGuide\n\n### Level\n\n```go\nFINEST\nFINE\nDEBUG\nTRACE\nINFO\nWARNING\nERROR\nCRITICAL\n```\n\nFeature list:\n\n* Output colorful terminal log string by log level\n* Output json log\n* Add maxbackup choice in examples.xml to delete out of date log file\n* Output escape query string safety\n* Add filename to every log line\n* Create log path if log path does not exist\n* Add caller option to let log4go do not output file/function-name/line-number\n* Add %P to output process ID\n* Rotate log file daily/hourly\n* Support json/xml/yml configuration file\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexstocks%2Flog4go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexstocks%2Flog4go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexstocks%2Flog4go/lists"}