{"id":22059244,"url":"https://github.com/opentable/hapi-ot-logger","last_synced_at":"2025-03-23T17:13:24.353Z","repository":{"id":22040863,"uuid":"25369258","full_name":"opentable/hapi-ot-logger","owner":"opentable","description":"[DEPRECATED] hapi logging compliant to ot-logging standards","archived":false,"fork":false,"pushed_at":"2019-07-30T12:11:45.000Z","size":47,"stargazers_count":0,"open_issues_count":1,"forks_count":3,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-03-12T22:03:07.400Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/opentable.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2014-10-17T17:30:38.000Z","updated_at":"2020-12-19T19:23:47.000Z","dependencies_parsed_at":"2022-08-18T21:20:15.387Z","dependency_job_id":null,"html_url":"https://github.com/opentable/hapi-ot-logger","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentable%2Fhapi-ot-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentable%2Fhapi-ot-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentable%2Fhapi-ot-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentable%2Fhapi-ot-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opentable","download_url":"https://codeload.github.com/opentable/hapi-ot-logger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245136405,"owners_count":20566588,"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":[],"created_at":"2024-11-30T17:27:42.243Z","updated_at":"2025-03-23T17:13:24.324Z","avatar_url":"https://github.com/opentable.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [DEPRECATED] hapi-ot-logger\n\u003e OpenTable standard-compliant logging plugin for Hapi.\n\n[![Build Status](https://travis-ci.org/opentable/hapi-ot-logger.svg?branch=master)](https://travis-ci.org/opentable/hapi-ot-logger)\n[![Dependency Status](https://david-dm.org/opentable/hapi-ot-logger.svg)](https://david-dm.org/opentable/hapi-ot-logger)\n[![devDependency Status](https://david-dm.org/opentable/hapi-ot-logger/dev-status.svg)](https://david-dm.org/opentable/hapi-ot-logger#info=devDependencies)\n[![npm version](https://badge.fury.io/js/hapi-ot-logger.svg)](https://badge.fury.io/js/hapi-ot-logger)\n\n## Usage\n```bash\n$ npm i hapi-ot-logger --save\n```\n\n```javascript\nvar server = new (require('hapi').Server)();\nserver.connection({ port: 3000 });\n\nserver.register([\n    {\n        register: require('hapi-ot-logger'),\n        options: {\n          servicetype: \"myservice\",\n          versions: {\n            request: 'v2',\n            log: 'v3',\n            error: 'v2'\n          },\n          redis: {\n            host: '127.0.0.1',\n            port: 6379,\n            listname: 'logs'\n          },\n          console: true,\n          payload: false,\n          validate: function(log) {\n            return log.logname === 'request' \u0026\u0026 log.headers['user-agent'] !== 'noisy-spider';\n          },\n          preSend: function(req, log) {\n            log.customAttribute = req.context.someAttribute;\n          }\n        }\n    }\n], function (err) {\n    if (err) {\n        console.error('Failed to load plugin:', err);\n    }\n\n    server.start();\n});\n```\n\n## Configuration\n- **servicetype** - unique service type\n- **versions** -  \n    - **request** - request log version\n    - **log** - diagnostic log version\n    - **error** - error log version\n- **redis**\n    - **host** - redis server hostname or IP address\n    - **port** - redis server port\n    - **listname** - redis list name\n- **console** - *(optional)* enable console output for debugging\n- **payload** - *(optional)* include request payload\n- **validate** - *(optional)* validates that a message should be logged\n- **preSend** - *(optional)* enables modification of log message\n\n## Release History\n- **v3.2.2** (2019-07-29)\n    - update packages\n- **v3.2.1** (2016-08-19)\n    - disable plugin option validation as it is a breaking change\n- **v3.2.0** (2016-08-18)\n    - added optional `preSend(req, log)` function to enable modification of log message\n- **v3.1.0** (2015-11-14)\n    - ???\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopentable%2Fhapi-ot-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopentable%2Fhapi-ot-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopentable%2Fhapi-ot-logger/lists"}