{"id":17115733,"url":"https://github.com/pathikrit/scrivener","last_synced_at":"2026-07-04T10:31:01.591Z","repository":{"id":2514651,"uuid":"3490307","full_name":"pathikrit/Scrivener","owner":"pathikrit","description":"A distributed asynchonous logging/statistics framework","archived":false,"fork":false,"pushed_at":"2012-03-08T20:05:20.000Z","size":244,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T00:49:19.153Z","etag":null,"topics":["java","stats"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pathikrit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-02-20T02:51:55.000Z","updated_at":"2014-04-25T18:15:56.000Z","dependencies_parsed_at":"2022-09-07T03:10:52.349Z","dependency_job_id":null,"html_url":"https://github.com/pathikrit/Scrivener","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pathikrit/Scrivener","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pathikrit%2FScrivener","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pathikrit%2FScrivener/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pathikrit%2FScrivener/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pathikrit%2FScrivener/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pathikrit","download_url":"https://codeload.github.com/pathikrit/Scrivener/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pathikrit%2FScrivener/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279010328,"owners_count":26084738,"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","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["java","stats"],"created_at":"2024-10-14T17:46:18.647Z","updated_at":"2025-10-12T05:42:56.844Z","avatar_url":"https://github.com/pathikrit.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"**Scrivener** is a simple log/stat aggregation framework inspired by Facebook's Scribe project:\n\n- **Distributed Logging**: A single server sees all log/stat messages. Makes co-relation easier for a distributed platform.\n- **Stat Framework**: Easy stat framework. A single static method stat(key,num). If you want to keep counters, simply call stat(key,1).\n- **Integrated Viewer**: A web based log/statistics viewer. No need to ssh into bunch of different servers.\n\n---\n\n**Java Client**:\nSimple Java client - S4J.java has 4 essential public static methods:\n\n- **config**(appId, server): Call at the entry point of your app with appId and Scrivener server. Group of related programs should have same appId.\n- **debug/warn/error/log**: Simple static methods that uses reflection (in separate thread) to figure out filename and line number etc\n- **stat**: Takes in key and a number. Visualizations are auto generated on server side.\n- **stop**: Optionally call this at the exit point of your app to make sure all messages are flushed.\n\nNotes:\n\n- **Asynchronous Logging**: Messages are put in a light-weight blocking-queue on the client-side and a separate consumer-thread pulls them out from the queue and sends to server. Blazingly fast logging.\n- **Simple Interface**: More info logs (line-numbering) without overheads. No more Logger.getLogger(classname). Simply static import the public methods of S4J.java. Stacktracking/caller-filename-inference are all done in a separate thread using reflection.\n- **Fall-back Option**: Optionally, logs to local loggger (default is log4j) too\n\n---\n\n**Server**:\nA simple nodejs server backed by couchdb (sharded by appIds) that accepts log/stat messages. Available API methods:\n\n-   POST   /log?appid=xxx\u0026entry={user:x,host:y,timestamp:unixtime,message:blah,stacktrace:s} (any arbitrary json entry)\n-    GET   /log?appid=xxx\u0026since=timestamp\n- DELETE   /log?appid=xxx\n-    GET  /stat?appid=xxx\u0026since=timestamp\n-   POST  /stat?appid=xxx\u0026entry={key:uniq_stat_key,timestamp:unixtime,value:a_num}\n- DELETE  /stat?appid=xxx\n\n---\n\n**Viewer**:\nThe same nodejs server serves a single page web app for log/stat visualization at the root-level:\n\n-    GET  /\n\nThe client side visualization uses d3/Google Charts API with jquery/underscore.js sugar\n\n---\n\n**Usage**:\n\n- Use in Java? Look at test package - has basic usage S4JExample.java and some other examples e.g. backfill stats from db etc\n- Install and start the server - First run setup.sh which should install everything necessary and then run start_server.sh\n- The intended usage of the stat framework is for adhoc statistics and corelation between different stat keys in a app (or within a group of apps)\n- The stat framework should not be used for system monitoring tasks like uptime, cpu, memory etc. There are better low level tools like cacti, htop, graphite, collectd, nagios etc.\n\n---\n\n**Todo**:\n\n- Websockets and since parameter to push updates\n- Log4J fallback\n- Figure out github repo automatically in Java\n- Advanced log filtering (regex, sql like syntax)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpathikrit%2Fscrivener","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpathikrit%2Fscrivener","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpathikrit%2Fscrivener/lists"}