{"id":37131838,"url":"https://github.com/alexv99/gol","last_synced_at":"2026-01-14T15:17:16.712Z","repository":{"id":57491508,"uuid":"206664446","full_name":"alexv99/gol","owner":"alexv99","description":"Simple logging utility written in Go.","archived":false,"fork":false,"pushed_at":"2021-03-15T21:55:41.000Z","size":37,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-20T10:10:59.286Z","etag":null,"topics":["golang","golang-library","golang-package","logging","logging-framework","logging-library"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexv99.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-05T22:00:57.000Z","updated_at":"2024-06-20T10:10:59.287Z","dependencies_parsed_at":"2022-08-30T23:22:13.539Z","dependency_job_id":null,"html_url":"https://github.com/alexv99/gol","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/alexv99/gol","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexv99%2Fgol","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexv99%2Fgol/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexv99%2Fgol/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexv99%2Fgol/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexv99","download_url":"https://codeload.github.com/alexv99/gol/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexv99%2Fgol/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28424117,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T13:30:50.153Z","status":"ssl_error","status_checked_at":"2026-01-14T13:29:08.907Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["golang","golang-library","golang-package","logging","logging-framework","logging-library"],"created_at":"2026-01-14T15:17:16.104Z","updated_at":"2026-01-14T15:17:16.700Z","avatar_url":"https://github.com/alexv99.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gol\n[![License](http://img.shields.io/badge/license-mit-blue.svg?style=flat-square)](https://raw.githubusercontent.com/alexv99/gol/master/license.txt)\n\nSimple logging utility with a few goodies:\n\u003cul\u003e\n\u003cli/\u003e Asynchronous (requests don't do disk IOs for logging)\n\u003cli/\u003e Log rotation (gol will create new log file once a configurable size is reached)\n\u003cli/\u003e Purge log files that are older than a configurable number of days\n\u003cli/\u003e (Hopefully) sensible default values for all parameters\n\u003cli/\u003e Easy interface for logging public access (a la Apache Web Server)\n\u003c/ul\u003e\n\nLatest version: [v1.0.3](https://github.com/alexv99/gol/releases/tag/v1.0.3) (can be imported as a Go module)\n\n## Usage\n\n```\nimport \"github.com/deal/gol\"\n\ngol.SetAppLogFolder(\"/path/to/log/folder\")     // Log folder for service log (default /var/log)\ngol.SetPublicLogFolder(\"/path/to/log/folder\")  // Log folder for public access log (default /var/log)\ngol.SetPublicLogMaxSize(200)  // Maximum size of a log file in KB\ngol.SetPublicLogMaxAge(20)    // Max age of a file before it's being purged in days (default 10 days)\ngol.LogToStdout(true)         // Also log to stdout  (default true)\ngol.ShowLineNumbers(false)    // Show file name and line number (default false)\n\ngol.start()  // Start gol (typically in the init() method of the main file of a service)\n\ngol.SetAppLogLevel(gol.INFO)  // Set the logging level (default INFO)\n\ngol.Debug(\"my message\")   // logs a debug message (async)\ngol.Info(\"my message\")    // logs an info message (async)\ngol.Warn(\"my message\")    // logs a warning message (async)\ngol.Error(\"my message\")   // logs an error message (async)\ngol.Fatal(\"my message\")   // *synchronously* logs a fatal message and exit with code 1\n\ngol.Public(myRequest)  // Logs info about the http request and response (Apache web server style)\n\ngol.Stop()  // stops gol (typically during graceful shutdown of the service.)\n```\n\n## Log file names\n\nService log files and public access log files will look like this:\n```\nalex@ip-192-168-1-14:~/work/deal/dev5/src/shorty/logs --\u003e ls -alh\n-rw-r--r--   1 alex  staff   100MB Aug 17 19:52 APP-LOG-2017-08-18-0\n-rw-r--r--   1 alex  staff   100MB Aug 17 19:55 APP-LOG-2017-08-18-1\n-rw-r--r--   1 alex  staff   100MB Aug 17 20:05 APP-LOG-2017-08-18-2\n-rw-r--r--   1 alex  staff   100MB Aug 17 20:09 PUBLIC-ACCESS-LOG-2017-08-18-0\n-rw-r--r--   1 alex  staff   100MB Aug 17 20:12 PUBLIC-ACCESS-LOG-22017-08-18-1\n-rw-r--r--   1 alex  staff   100MB Aug 17 20:13 PUBLIC-ACCESS-LOG-22017-08-18-2\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexv99%2Fgol","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexv99%2Fgol","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexv99%2Fgol/lists"}