Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hartfordfive/golog
A simple self contained web server process that logs data from incoming HTTP request
https://github.com/hartfordfive/golog
Last synced: about 8 hours ago
JSON representation
A simple self contained web server process that logs data from incoming HTTP request
- Host: GitHub
- URL: https://github.com/hartfordfive/golog
- Owner: hartfordfive
- License: mit
- Created: 2013-09-11T17:45:17.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2016-10-04T17:42:14.000Z (about 8 years ago)
- Last Synced: 2024-06-21T03:14:49.977Z (5 months ago)
- Language: Go
- Size: 43.9 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
GoLog
=====A simple self contained web server process that logs data from incoming HTTP request.
## Notice
**This project is no longer maintained. Considering it was from my earlier days in Go development, it has a variety of bugs, especially concurency related ones. Unfortunately these won't be fixed. For a more recent version of a similar application (with better concucrency), please see the [Logger](https://github.com/hartfordfive/Logger) application.**
Dependencies:
--------------------
Redis Server
MaxMind C development library libgeoip-dev
Go Redis Client (github.com/fzzy/radix - v0.3.4)
Go GeoIP Client (github.com/abh/geoip - at least from commit 6fd87ec2cc or newer)
MaxMind GeoIP Legacy DBs (http://geolite.maxmind.com/download/geoip/database/)Usage:
--------------------`go run golog.go -i [IP] -p [PORT] -b [BUFF_LINES] -db [REDIS_DB_INDEX] -d [LOGFILES_DIRECTORY] -domain [DOMAIN]`
or with compiled binary:
`./golog -i [IP] -p [PORT] -b [BUFF_LINES] -db [REDIS_DB_INDEX] -d [LOGFILES_DIRECTORY] -domain [DOMAIN]`
Parameter details:
--------------------`-version` : Simply prints the current version and exits
`-i` : The IP to start the logging server on (default = 0.0.0.0)
`-p` : The port on which to listen (default = 80)
`-b` : The number of lines to store in the buffer before writing to disk (default = 25)
`-db` : The index number of the redis DB to use (default = 2)
`-flushredis` : Setting value to 1 will flush the selected redis DB on startup (default = 0)
`-d` : The directory in which the logfiles are to be stored (default = /var/log/golog/)
`-domain` : The domain for which to set the UDID cookie on
`-stats` : Option that specifies if the server will report stats via HTTP (default = 0)
`-ri` : The IP on which the reporting server will listen
`-rp` : The port on which the reporting server will listen
`-conf` : The config file to use to start up the process, instead of specifying all params via command lineHTTP Tracking URL Format:
----------------------
Place this url in a tracking pixel somewhere at the bottom of your HTML code
`http://[DOMAIN]:[PORT]?cid=[CID]&category=[CATEGORY]&action=[ACTION]&label=[LABEL]&value=[VALUE]&rnd=[RAND_INT]``[DOMAIN]` -> The domain of the website collecting the stats
`[PORT]` -> The port on which the tracking server is listening
`[CID]` -> The Client ID of the user account. (Arbitrary identifier decided by tracking server owner, same concept as a Google Analytics tracking code)
`[CATEGORY]` -> Based on same concept as the Google event tracking parameters (https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide#SettingUpEventTracking)
`[ACTION]` -> ** View explanation for `[CATEGORY]` **
`[LABEL]` -> ** View explanation for `[CATEGORY]` **
`[VALUE]` -> A numeric value to give this tracking request, typically 1
`[RAND_INT]` -> A random integer (suggested between 1 and at least 1000000) that prevents this HTTP request from being cached
HTTP Stats Monitoring:
----------------------
`http://[BASE_DOMAIN]:[STATS_PORT]/stats` -> Returns a JSON encoded object containing cumulative stats showing the number of visits from each continent and country broken down by hour of the day`http://[BASE_DOMAIN]:[STATS_PORT]/statsdevices` -> Returns JSON encoded object containing cumulative stats regarding user agents, such OS, OS version, user agent type, rendering engine, etc.
`http://[BASE_DOMAIN]:[STATS_PORT]/statsvisitors?domain=[DOMAIN]` -> Returns JSON encoded object containing the pages currently visited for the specified domain
`http://[BASE_DOMAIN]:[STATS_PORT]/statsgeovisitors?continent_code=[CONTENT_CODE]&country_code=[COUNTRY_CODE]` -> Returns JSON encoded object containing the approximate geo-coordinates of each visitor in the current day
Stats Monitoring Parameter Details:
-----------------------------------`[DOMAIN]` -> The domain name for which to filter the stats
`[CONTINENT_CODE]` -> The two letter code of the continent, or the wildcard (*) for all continents
`[COUNTRY_CODE]` -> The two letter code of the country, or the wildcard (*) for all coutries** Please note that specifying * for the CONTINENT_CODE will also directly result in a wildcard for the COUNTRY_CODE
[![githalytics.com alpha](https://cruel-carlota.pagodabox.com/f70384f88bf609745a1ae8a3d9255f01 "githalytics.com")](http://githalytics.com/hartfordfive/golog)