{"_id":"structured-log","_rev":"17-98770d0be04fdf8b638083f0971bb216","name":"structured-log","description":"A structured logging framework for JavaScript, inspired by Serilog.","dist-tags":{"latest":"0.2.0"},"versions":{"0.0.2":{"name":"structured-log","version":"0.0.2","description":"NodeJS development/testing version of Serilog.","main":"serilog.js","scripts":{},"repository":{"type":"git","url":"git+https://github.com/structured-log/serilog.js.git"},"keywords":["logging","structured","semantic"],"author":{"name":"Serilog Contributors"},"license":"Apache 2","bugs":{"url":"https://github.com/structured-log/serilog.js/issues"},"homepage":"https://github.com/structured-log/serilog.js#readme","_id":"structured-log@0.0.2","_shasum":"fc938cf26d0116ab99c894d64c1bdbd5ec6e3b81","_from":".","_npmVersion":"2.10.1","_nodeVersion":"0.12.4","_npmUser":{"name":"ashleydavis","email":"ashley@codecapers.com.au"},"maintainers":[{"name":"ashleydavis","email":"ashley@codecapers.com.au"}],"dist":{"shasum":"fc938cf26d0116ab99c894d64c1bdbd5ec6e3b81","tarball":"https://registry.npmjs.org/structured-log/-/structured-log-0.0.2.tgz","integrity":"sha512-T8LVa5x4UQdUrRKabBc17u6OmlrO6FKCSvgp2Fz9NiNAiCspDGr6lBYhS7z4d19/tiVXGIKe45V4TT1nvyT5BQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCrp0EiYVWUfs00lsPUNOcyXBOISlx2k5A5pBMkkEvQBwIhAPuxW3BBidOIzP8yon/vVyubzKBWtxrdhm9ZbpML7s7+"}]}},"0.0.3":{"name":"structured-log","version":"0.0.3","description":"NodeJS structured logging framework based on Serilog.","main":"serilog.js","scripts":{},"repository":{"type":"git","url":"git+https://github.com/structured-log/structured-log.git"},"keywords":["logging","structured","semantic"],"author":{"name":"Structured-log Contributors"},"license":"Apache 2","bugs":{"url":"https://github.com/structured-log/structured-log/issues"},"homepage":"https://github.com/structured-log/structured-log#readme","_id":"structured-log@0.0.3","_shasum":"7453e7f4bd655eaac1b64c4f4c0a7312dccb9c48","_from":".","_npmVersion":"2.10.1","_nodeVersion":"0.12.4","_npmUser":{"name":"ashleydavis","email":"ashley@codecapers.com.au"},"maintainers":[{"name":"ashleydavis","email":"ashley@codecapers.com.au"},{"name":"nblumhardt","email":"nblumhardt@nblumhardt.com"}],"dist":{"shasum":"7453e7f4bd655eaac1b64c4f4c0a7312dccb9c48","tarball":"https://registry.npmjs.org/structured-log/-/structured-log-0.0.3.tgz","integrity":"sha512-akDcBuTbOvAk1MiPVipQgQK7U/hYibKubER/UEZuHDUN68I2mVtMD7q3oM0PmCiBB8UPT78oy/yja9WQFTN5sQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBYCJ2oiI3UOkJAKJSVQYvqwwMnHXIZyzfsLEyWnV3zHAiEA7/U3H6fhF9tNxK3X4zSRGGk5tNgZGwq3TqCm8LjRy20="}]}},"0.0.4":{"name":"structured-log","version":"0.0.4","description":"NodeJS structured logging framework based on Serilog.","main":"serilog.js","scripts":{},"repository":{"type":"git","url":"git+https://github.com/structured-log/structured-log.git"},"keywords":["logging","structured","semantic"],"author":{"name":"Structured-log Contributors"},"license":"Apache 2","bugs":{"url":"https://github.com/structured-log/structured-log/issues"},"homepage":"https://github.com/structured-log/structured-log#readme","_id":"structured-log@0.0.4","_shasum":"3a476ccd3f6c733215d1334554a0ff7239822126","_from":".","_npmVersion":"2.10.1","_nodeVersion":"0.12.4","_npmUser":{"name":"ashleydavis","email":"ashley@codecapers.com.au"},"maintainers":[{"name":"ashleydavis","email":"ashley@codecapers.com.au"},{"name":"nblumhardt","email":"nblumhardt@nblumhardt.com"}],"dist":{"shasum":"3a476ccd3f6c733215d1334554a0ff7239822126","tarball":"https://registry.npmjs.org/structured-log/-/structured-log-0.0.4.tgz","integrity":"sha512-rUADQ278vDy0Fwl9pbjgZzG/yhqEgOIFGOrvpBXx7nosvjc+lrBpiNIWYMf6fAUFhdZW3PQnKAVkS6Pf9m/G+Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFbSL7WjdlGrKD4Xm3lSvelTt02YEYNErYzYkThTq+rjAiAbtEhBXaOXyTVS/8A8QjnJ0u0cXVUDXjy36qc8vGbs6Q=="}]}},"0.0.5":{"name":"structured-log","version":"0.0.5","description":"NodeJS structured logging framework based on Serilog.","main":"serilog.js","scripts":{},"repository":{"type":"git","url":"git+https://github.com/structured-log/structured-log.git"},"keywords":["logging","structured","semantic"],"author":{"name":"Structured-log Contributors"},"license":"Apache 2","bugs":{"url":"https://github.com/structured-log/structured-log/issues"},"homepage":"https://github.com/structured-log/structured-log#readme","_id":"structured-log@0.0.5","_shasum":"3b0d482cdbe526a395f403c73e929cf044bc469f","_from":".","_npmVersion":"2.10.1","_nodeVersion":"0.12.4","_npmUser":{"name":"ashleydavis","email":"ashley@codecapers.com.au"},"maintainers":[{"name":"ashleydavis","email":"ashley@codecapers.com.au"},{"name":"nblumhardt","email":"nblumhardt@nblumhardt.com"}],"dist":{"shasum":"3b0d482cdbe526a395f403c73e929cf044bc469f","tarball":"https://registry.npmjs.org/structured-log/-/structured-log-0.0.5.tgz","integrity":"sha512-tqxRNq6yDqalp6baRVMPf1GOSQpAVBkT93e4veJ0tuYp0u4pEiu5qQ9UF2k84gWnbQNpNvxvlxO0ST31ndCV2A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDtPR5MClihK0cMz1kc1mDn/zNR7Ug5qR1TvVqwBkN2HAIhANg/nrO72+O8ixeSvOOcKBpIgvaR2VSMsmUyOmdg2mm0"}]}},"0.0.13":{"name":"structured-log","version":"0.0.13","description":"(Development version). NodeJS structured logging framework based on Serilog.","main":"structured-log.js","scripts":{},"repository":{"type":"git","url":"https://github.com/structured-log/structured-log"},"keywords":["logging","structured","semantic"],"author":{"name":"Structured-log Contributors"},"license":"Apache 2","bugs":{"url":"https://github.com/structured-log/structured-log/issues"},"homepage":"https://github.com/structured-log/structured-log","_id":"structured-log@0.0.13","_shasum":"12d4f1ac5e3da8e2f11af605db28a2466b0f3700","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"ashleydavis","email":"ashley@codecapers.com.au"},"maintainers":[{"name":"ashleydavis","email":"ashley@codecapers.com.au"},{"name":"nblumhardt","email":"nblumhardt@nblumhardt.com"}],"dist":{"shasum":"12d4f1ac5e3da8e2f11af605db28a2466b0f3700","tarball":"https://registry.npmjs.org/structured-log/-/structured-log-0.0.13.tgz","integrity":"sha512-VL3tJlU3NkrQpuwjZbmdA1vphJrUSF62eT/jA4X6BAPF+WMtwIUvXVydm+V+g5U1/tRjFR5rNKCRDVd04dUXGw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCWZ3TNiyHJnFaSVo6cfUONdNtyKWcuv9HF5ZoAHLNjkQIgC0St6PTYYTb8gIV1FuZPIZ/rubB7mPywrRYUK5JaTeo="}]}},"0.0.14":{"name":"structured-log","version":"0.0.14","description":"(Development version). NodeJS structured logging framework based on Serilog.","main":"structured-log.js","scripts":{},"repository":{"type":"git","url":"git+https://github.com/structured-log/structured-log.git"},"keywords":["logging","structured","semantic"],"author":{"name":"Structured-log Contributors"},"license":"Apache 2","bugs":{"url":"https://github.com/structured-log/structured-log/issues"},"homepage":"https://github.com/structured-log/structured-log#readme","_id":"structured-log@0.0.14","_shasum":"1fac64954b598c3587767b0fdc8aed7059c0399f","_from":".","_npmVersion":"2.10.1","_nodeVersion":"0.12.4","_npmUser":{"name":"ashleydavis","email":"ashley@codecapers.com.au"},"maintainers":[{"name":"ashleydavis","email":"ashley@codecapers.com.au"},{"name":"nblumhardt","email":"nblumhardt@nblumhardt.com"}],"dist":{"shasum":"1fac64954b598c3587767b0fdc8aed7059c0399f","tarball":"https://registry.npmjs.org/structured-log/-/structured-log-0.0.14.tgz","integrity":"sha512-KYF2KcraAqUIYkzrNMCqhlj03LfX/W0ETvVM9lfnAp+Z9f0kbZt2bIDXEqYlXS/fbdYYJvOofVZ1mv1NoXUbGg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICWJsqSo2Sxl6dZRnD2bnLnZKFvpwlleMm+o9oXkL0RHAiEAr7CjWSPCOpbJCgY8IdFW+8tWSp91tFGeUAtiVWdImWU="}]}},"0.0.15":{"name":"structured-log","version":"0.0.15","description":"(Development version). NodeJS structured logging framework based on Serilog.","main":"structured-log.js","scripts":{},"repository":{"type":"git","url":"git+https://github.com/structured-log/structured-log.git"},"keywords":["logging","structured","semantic"],"author":{"name":"Structured-log Contributors"},"license":"Apache 2","bugs":{"url":"https://github.com/structured-log/structured-log/issues"},"homepage":"https://github.com/structured-log/structured-log#readme","_id":"structured-log@0.0.15","_shasum":"66b9c04a40c0e7ce113ab5cb71c220c352d58446","_from":".","_npmVersion":"2.10.1","_nodeVersion":"0.12.4","_npmUser":{"name":"ashleydavis","email":"ashley@codecapers.com.au"},"maintainers":[{"name":"ashleydavis","email":"ashley@codecapers.com.au"},{"name":"nblumhardt","email":"nblumhardt@nblumhardt.com"}],"dist":{"shasum":"66b9c04a40c0e7ce113ab5cb71c220c352d58446","tarball":"https://registry.npmjs.org/structured-log/-/structured-log-0.0.15.tgz","integrity":"sha512-Pklwchj/BsDmdsI29WaZDZeuMkThVMUL3OkLgxfYf7YCgIBpc2D+7UnNobTANqxdJrAvC6EsJ76PSoJblk5M0Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA8aZqaSjktrd5uI9l6EUYysVoaTn1tlmDp7WjwiI/SMAiA5vbSgaSiAwAj7owAq4oM7ZDV0a5ZvNiNO2yKjLv+n9g=="}]}},"0.0.16":{"name":"structured-log","version":"0.0.16","description":"(Development version). NodeJS structured logging framework based on Serilog.","main":"structured-log.js","scripts":{},"repository":{"type":"git","url":"git+https://github.com/structured-log/structured-log.git"},"keywords":["logging","structured","semantic"],"author":{"name":"Structured-log Contributors"},"license":"Apache 2","bugs":{"url":"https://github.com/structured-log/structured-log/issues"},"homepage":"https://github.com/structured-log/structured-log#readme","_id":"structured-log@0.0.16","_shasum":"821ae20fafd138ee424b56127c917a35e72045a7","_from":".","_npmVersion":"2.10.1","_nodeVersion":"0.12.4","_npmUser":{"name":"ashleydavis","email":"ashley@codecapers.com.au"},"maintainers":[{"name":"ashleydavis","email":"ashley@codecapers.com.au"},{"name":"nblumhardt","email":"nblumhardt@nblumhardt.com"}],"dist":{"shasum":"821ae20fafd138ee424b56127c917a35e72045a7","tarball":"https://registry.npmjs.org/structured-log/-/structured-log-0.0.16.tgz","integrity":"sha512-kTZ8GUYGkV4AjEFkahkF7OhxY0ocGzh8gqqw6O3mVqj5FwVciIjdJWpxl+e34auPL2EKHmR+xsXUELWRg4ZKwg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDeEQWUojma7zFaPyBn9hbFPHz/cL8QGzodAjRrH791EwIhAPEm2cVQt1NV1xHTDby7aiAsP9tfiUj3jmC/eHlw+DVs"}]}},"0.0.18":{"name":"structured-log","version":"0.0.18","description":"(Development version). NodeJS structured logging framework based on Serilog.","main":"structured-log.js","scripts":{},"repository":{"type":"git","url":"git+https://github.com/structured-log/structured-log.git"},"keywords":["logging","structured","semantic"],"author":{"name":"Structured-log Contributors"},"license":"Apache 2","bugs":{"url":"https://github.com/structured-log/structured-log/issues"},"homepage":"https://github.com/structured-log/structured-log#readme","_id":"structured-log@0.0.18","_shasum":"73f976e5d951c312bbe679a51b0842aa50b794f1","_from":".","_npmVersion":"2.10.1","_nodeVersion":"0.12.4","_npmUser":{"name":"ashleydavis","email":"ashley@codecapers.com.au"},"maintainers":[{"name":"ashleydavis","email":"ashley@codecapers.com.au"},{"name":"nblumhardt","email":"nblumhardt@nblumhardt.com"}],"dist":{"shasum":"73f976e5d951c312bbe679a51b0842aa50b794f1","tarball":"https://registry.npmjs.org/structured-log/-/structured-log-0.0.18.tgz","integrity":"sha512-yVRuJqhO/NTyD+aSmgfoyodnDf6akZkg2ze7UxuWf7NN07HU0y07hRrg9ann/BadoYzUKRmrEKDfqnzp1zQ51Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHL6r9MojmX1jZ0VR5O5Axgjlx7/TTP0SdIwiLIJJzxVAiAk/gjnKqV6Ad+bR2ZO/o3DaqR4C/IPkt0DQzc3P9Jqfg=="}]}},"0.1.0":{"name":"structured-log","version":"0.1.0","description":"A structured logging framework for JavaScript, inspired by Serilog.","main":"dist/structured-log.js","jsnext:main":"dist/structured-log.es6.js","scripts":{"test":"mocha --compilers ts:ts-node/register -r src/polyfills/objectAssign.js test/**/*.spec.ts","test-coverage":"ts-node node_modules/istanbul/lib/cli.js cover -e .ts -x \"*.d.ts\" -x \"*.spec.ts\" node_modules/mocha/bin/_mocha -- -r src/polyfills/objectAssign.js test/**/*.spec.ts","build-es5":"rollup -c rollup.config.es5.js","build-es6":"rollup -c rollup.config.es6.js","build":"npm run build-es5 && npm run build-es6","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/structured-log/structured-log.git"},"keywords":["logging","structured","semantic","serilog"],"author":{"name":"structured-log Contributors"},"license":"Apache-2.0","bugs":{"url":"https://github.com/structured-log/structured-log/issues"},"devDependencies":{"@types/chai":"^3.4.34","@types/mocha":"^2.2.35","@types/node":"^6.0.57","chai":"^3.5.0","coveralls":"^2.11.15","istanbul":"^1.1.0-alpha.1","mocha":"^3.2.0","rollup":"^0.40.1","rollup-plugin-typescript":"^0.8.1","ts-node":"^2.0.0","typemoq":"^1.1.0","typescript":"^2.1.4"},"gitHead":"74bfaceba5aa485de049a335c7587b9c8a4ea2cc","homepage":"https://github.com/structured-log/structured-log#readme","_id":"structured-log@0.1.0","_shasum":"79f3947cc2cf7f300542c4f9318f2abc143d2fa2","_from":".","_npmVersion":"3.9.5","_nodeVersion":"6.2.2","_npmUser":{"name":"wedvich","email":"wedvich@gmail.com"},"dist":{"shasum":"79f3947cc2cf7f300542c4f9318f2abc143d2fa2","tarball":"https://registry.npmjs.org/structured-log/-/structured-log-0.1.0.tgz","integrity":"sha512-FUo6GB1uSwNu4hnVLZItKOQQcSG3x8LqDU4c5WyJkYxt1LeMlAosu6AQ3M5Th1atGBYaZAg6s43wOTK3m8WDFA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG1qnM+ZnAR9h60CjSU6m6vjr+tpJHr5mAM7VT07cX3WAiEAgNgVOFPLdi40qiHAcEBmmlYDLvouPG1l0C99jgTgqsk="}]},"maintainers":[{"name":"ashleydavis","email":"ashley@codecapers.com.au"},{"name":"nblumhardt","email":"nblumhardt@nblumhardt.com"},{"name":"wedvich","email":"wedvich@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/structured-log-0.1.0.tgz_1484682922087_0.2807377395220101"}},"0.2.0":{"name":"structured-log","version":"0.2.0","description":"A structured logging framework for JavaScript, inspired by Serilog.","main":"dist/structured-log.js","jsnext:main":"dist/structured-log.es6.js","scripts":{"test":"jest","test-watch":"jest --watch","test-coverage":"jest --coverage","build-es5":"rollup -c rollup.config.es5.js","build-es6":"rollup -c rollup.config.es6.js","build":"npm run build-es5 && npm run build-es6","prepublish":"npm run build"},"jest":{"transform":{"^.+\\.tsx?$":"./node_modules/ts-jest/preprocessor.js"},"testRegex":"(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$","moduleFileExtensions":["ts","tsx","js","jsx","json"]},"repository":{"type":"git","url":"git+https://github.com/structured-log/structured-log.git"},"keywords":["logging","structured","semantic","serilog"],"author":{"name":"structured-log Contributors"},"license":"Apache-2.0","bugs":{"url":"https://github.com/structured-log/structured-log/issues"},"devDependencies":{"@types/chai":"^3.4.34","@types/es6-promise":"0.0.32","@types/jest":"^21.1.1","@types/node":"^6.0.57","chai":"^3.5.0","coveralls":"^2.11.15","es6-promise":"^4.0.5","es6-symbol":"^3.1.0","jest":"^21.1.0","rollup":"^0.40.1","rollup-plugin-typescript":"^0.8.1","ts-jest":"^21.0.1","ts-node":"^3.0.0","typemoq":"^1.1.0","typescript":"^2.1.4"},"gitHead":"022ebe412b816e59a306a87fa7851379ff0e324d","homepage":"https://github.com/structured-log/structured-log#readme","_id":"structured-log@0.2.0","_npmVersion":"5.3.0","_nodeVersion":"8.5.0","_npmUser":{"name":"wedvich","email":"wedvich@gmail.com"},"dist":{"integrity":"sha512-W3Tps8PN5Mon37955/wuZZSXwBXiB52AUnd/oPVdmo+O+mLkr2fNajV6821gJ8irrgVQx3gYOqSWPMgj7Dy3Yg==","shasum":"b9be1794c39d6399f265666b84635a3307611c5b","tarball":"https://registry.npmjs.org/structured-log/-/structured-log-0.2.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCwFEwKu/w/EE1ozBmwYLyjdrN81XU9do5g+sXhMFZHOwIhALS42ryWZEGBttbJjNAawdynC7LR9hai5+DcHXUjbhDq"}]},"maintainers":[{"name":"ashleydavis","email":"ashley@codecapers.com.au"},{"name":"nblumhardt","email":"nblumhardt@nblumhardt.com"},{"name":"wedvich","email":"wedvich@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/structured-log-0.2.0.tgz_1506457761015_0.22238827007822692"}}},"readme":"# structured-log\r\n\r\nA structured logging framework for JavaScript, inspired by [Serilog](http://serilog.net/).\r\n\r\n[![npm](https://img.shields.io/npm/v/structured-log.svg)](https://www.npmjs.com/package/structured-log)\r\n[![Bower](https://img.shields.io/bower/v/structured-log.svg)]()\r\n[![Build Status](https://travis-ci.org/structured-log/structured-log.svg?branch=master)](https://travis-ci.org/structured-log/structured-log)\r\n\r\n## Basic Example\r\n\r\n```js\r\nconst structuredLog = require('structured-log');\r\n\r\nconst log = structuredLog.configure()\r\n  .writeTo(new structuredLog.ConsoleSink())\r\n  .create();\r\n\r\nlog.info('Hello {Name}!', 'Greg');\r\n```\r\n\r\nThe above code will print the following to the console:\r\n\r\n    [Information] Hello Greg!\r\n\r\n## Installation\r\n\r\n**structured-log** is distributed through [npm](https://www.npmjs.com/package/structured-log) and [Bower](https://bower.io/). Run the following:\r\n\r\n    yarn add structured-log\r\n\r\nIf not using Yarn:\r\n\r\n    npm i --save structured-log\r\n\r\nOr, using Bower:\r\n\r\n    bower install structured-log\r\n\r\n> Note: **structured-log** embeds a polyfill for `Object.assign`, but you will need to bring your own\r\n> `Promise` polyfill to use it in an environment that doesn't support Promises natively.\r\n\r\n## Configuration\r\n\r\nConfiguring **structured-log** is a straightforward process, going through three steps.\r\nFirst, we initialize a new logging pipeline configuration by calling `configure()`:\r\n\r\n```js\r\nconst log = structuredLog.configure()\r\n```\r\n\r\nThe second step is the main step. Configuration of different\r\nfilters and targets is done by chaining methods together in a fluent syntax.\r\nEvents flow through the pipeline from top to bottom, so new filters and\r\nenrichers can be inserted between the different sinks to build a highly\r\ncontrollable pipeline.\r\n\r\n```js\r\n  .writeTo(new structuredLog.ConsoleSink())\r\n  .minLevel.warning()\r\n  .writeTo(new OtherExampleSink({ url: 'http://example.com' }))\r\n  .writeTo(...)\r\n```\r\n\r\nThe chain is closed by calling `create()`, which instantiates a new logger\r\ninstance based on the pipeline configuration.\r\n\r\n```js\r\n  .create();\r\n\r\n// The logger is ready for use!\r\nlog.verbose('Hello structured-log!');\r\n```\r\n\r\n### Log Levels\r\n\r\nThere are 6 log levels available by default, in addition to a setting to disable logging completely.\r\nIn decreasing order of severity (with descriptions borrowed from [Seq](https://github.com/serilog/serilog/wiki/Writing-Log-Events#log-event-levels)):\r\n\r\n|Label|Description|Bitfield|\r\n|---|---|---|\r\n|`off`|When the minimum level is set to this, nothing will be logged.|0|\r\n|`fatal`|Critical errors causing complete failure of the application.|1|\r\n|`error`|Indicates failures within the application or connected systems.|3|\r\n|`warning`|Indicators of possible issues or service/functionality degradatio.|7|\r\n|`information`|Events of interest or that have relevance to outside observers.|15|\r\n|`debug`|Internal control flow and diagnostic state dumps to facilitate pinpointing of recognised problems.|31|\r\n|`verbose`|Tracing information and debugging minutiae; generally only switched on in unusual situations.|63|\r\n\r\nThe log levels can also be represented as bitfields, and each log level also includes any levels of higher severity.\r\nFor example, `warning` will also allow events of the `error` level through, but block `information`,\r\n`debug` and `verbose`.\r\n\r\nA minimum level can be set anywhere in the pipeline to only allow events matching that level\r\nlevel or lower to pass further through the pipeline.\r\n\r\nThe below examples will all set the minimum level to `warning`:\r\n\r\n```js\r\n  .minLevel.warning()\r\n// or\r\n  .minLevel(7)\r\n// or\r\n  .minLevel('warning')\r\n```\r\n\r\nThere is no minimum level set by default, but a common choice is `Information`. Note that if a restrictive level is set\r\nearly in the pipeline, and a more permissive level is set further down, the events that are filtered out by the more\r\nrestrictive level will never reach the more permissive filter.\r\n\r\nThe Logger object contains shorthand methods for logging to each level.\r\n\r\n```js\r\nlog.fatal('Application startup failed due to a missing configuration file');\r\nlog.error('Could not parse response message');\r\nlog.warn('Execution time of {time} exceeded budget of {budget}ms', actualTime, budgetTime);\r\nlog.info('Started a new session');\r\nlog.debug('Accept-Encoding header value: {acceptEncoding}', response.acceptEncoding);\r\nlog.verbose('Exiting getUsers()');\r\n```\r\n\r\nYou can also pass an error object as the first argument to any of the logging methods, which will pass it along with\r\nthe event and allow it to be processed by the pipeline:\r\n\r\n```js\r\ntry {\r\n  // something that fails here\r\n } catch (error) {\r\n   log.error(error, error.message);\r\n }\r\n```\r\n\r\n#### Dynamically controlling the minimum level\r\n\r\nYou can also control the minimum level dynamically using the `DynamicLevelSwitch` class.\r\nPass an instance to the `minLevel()` function:\r\n\r\n```js\r\nconst dynamicLevelSwitch = new DynamicLevelSwitch();\r\n\r\n// ...\r\n\r\n  .minLevel(dynamicLevelSwitch)\r\n```\r\n\r\nYou can then call the same shorthand methods as those present on the `minLevel` object (`error()`, `debug()` etc.) to\r\ndynamically change the minimum level for the subsequent stages in the pipeline.\r\n\r\n```js\r\nlogger.debug('This message will be logged');\r\ndynamicLevelSwitch.warning();\r\nlogger.debug('This message won\\'t');\r\n```\r\n\r\n### Sinks\r\n\r\nA *sink* is a recipient for log events going through the pipeline, and is generally used to publish events to some\r\nexternal source such as the developer console, file system or an online service.\r\n\r\nTo add a sink as a target for log events in the pipeline, pass an instance to the `writeTo()` function.\r\n\r\n```js\r\n  .writeTo(new ExampleSink())\r\n```\r\n\r\nThe `Logger` object that's created with the `create()` method is also a valid sink,\r\nso you can pass it to another pipeline.\r\n\r\n```js\r\nconst logger1 = structuredLog.configure()\r\n  // ...\r\n  .create();\r\n\r\nconst logger2 = structuredLog.configure()\r\n  .writeTo(logger1)\r\n  .create();\r\n```\r\n\r\n#### Built-in sinks\r\n|Name|Description|\r\n|---|---|\r\n|[ConsoleSink](#console-sink)|Outputs events through the `console` object in Node or the browser.|\r\n\r\n#### 3rd party sinks\r\n|Name|Description|\r\n|---|---|\r\n|[SeqSink](https://github.com/Wedvich/structured-log-seq-sink)|Outputs events to a [Seq](https://getseq.net) server.|\r\n\r\n### Filtering\r\n\r\nYou can *filter* which events are passed through the pipeline using the `filter()` function. It takes\r\na single function parameter that will be used to test events going into the filter, and if it returns `true`,\r\nthe events will be allowed to continue through the pipeline.\r\n\r\nThe below example will filter out any log events with template properties, only\r\nallowing pure text events through to the next pipeline stage.\r\n\r\n```js\r\n  .filter(logEvent => logEvent.properties.length === 0)\r\n```\r\n\r\nThe predicate should take a log event as its only parameter, and return true or false.\r\n\r\n### Enrichment\r\n\r\nLog events going through the pipeline can be *enriched* with additional properties\r\nby using the `enrich()` function.\r\n\r\n```js\r\n  .enrich({\r\n    'version': 2,\r\n    'source': 'Client Application'\r\n  })\r\n```\r\n\r\nYou can also pass a function as the first argument, and return an object with the properties to enrich with.\r\nThis can be useful to dynamically add properties based on the current context or state of the application.\r\n\r\n```js\r\nconst state = {\r\n  user: null\r\n};\r\n\r\n// ...\r\n\r\n  .enrich(() => ({ user: state.user.name }))\r\n```\r\n\r\nThe enricher function will receive a copy of the event properties as its first argument, so that you can conditionally mask\r\nsensitive information from the event. This can be useful when you want to log detailed information in your local console, but not to external sinks further down the pipeline.\r\n\r\n```js\r\nlog.info('Incorrect client secret: {Secret}', secret});\r\n\r\n// ...\r\n\r\n  .enrich((properties) => {\r\n    if (properties.secret) {\r\n      return {\r\n        secret: 'MASKED'\r\n      };\r\n    }\r\n  })\r\n```\r\n\r\n> The `properties` argument is a deep clone of the event properties, and cannot be used to manipulate the source object directly (e.g. `delete properties.secret`).\r\n\r\n### Errors\r\n\r\nErrors in the logger are suppressed by default. To disable suppression, and allow errors to be propagated to\r\nthe environment, use the `suppressErrors()` function to set suppression to `false`.\r\n\r\n```js\r\n  .suppressErrors(false)\r\n```\r\n\r\nThis setting is global for the pipeline, so if it is called multiple times in the configuration chain, the value of\r\nthe last call will be used.\r\n\r\n> Only errors throw in the logging pipeline will be suppressed.\r\n> Errors that occur during configuration will always propagate.\r\n\r\n### Console Sink\r\n\r\nThe `ConsoleSink`, which outputs event to the Node.js or browser console, is provided by default.\r\nThe following line creates a new instance that can be passed to the logger configuration:\r\n\r\n```js\r\nvar consoleSink = new ConsoleSink({ /* options */ });\r\n```\r\n\r\nThe `options` object is optional, but can be used to modify the functionality of the sink.\r\nIt supports the following properties:\r\n\r\n|Key|Description|Default|\r\n|---|---|---|\r\n|`console`|An object with a console interface (providing `log()`, `info()`, etc.) that will be used by the sink when writing output.|`console` global|\r\n|`includeProperties`|If `true`, the properties of the log event will be written to the console in addition to the message.|`false`|\r\n|`includeTimestamps`|If `true`, timestamps will be included in the message that is written to the console.|`false`|\r\n|`restrictedToMinimumLevel`|If set, only events of the specified level or higher will be output to the console.||\r\n\r\n### Batched Sink\r\n\r\nThe `BatchedSink` allows for batching events periodically and/or by batch size.\r\n\r\nIt can either be used as a wrapper around existing sinks:\r\n\r\n```js\r\nvar batchedSink = new BatchedSink(new ConsoleSink(), { /* options */ });\r\n```\r\n\r\nOr, if developing a sink and using ES6 or TypeScript, you can use it as a base class to add batching capabilities:\r\n\r\n```js\r\nclass MySink extends BatchedSink {\r\n  constructor() {\r\n    super(null, { /* options */ });\r\n  }\r\n\r\n  // Override emitCore and/or flushCore to add your own sink's behavior\r\n\r\n  emitCore(events) {\r\n    // ...\r\n  }\r\n\r\n  flushCore() {\r\n    // ...\r\n\r\n    return Promise.resolve();\r\n    // If you don't return a promise,\r\n    // a resolved promise will be returned for you\r\n  }\r\n}\r\n```\r\n\r\nThe `options` object is optional, but can be used to modify the batching thresholds or add durability to the sink.\r\nIt supports the following properties:\r\n\r\n|Key|Description|Default|\r\n|---|---|---|\r\n|`durableStore`|An instance implementing the [Web Storage API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API) interface (such as `localStorage` in the browser, or [node-localstorage](https://github.com/lmaccherone/node-localstorage) for Node.js applications). If this is set, it will be used as an intermediate store for events until they have been successfully flushed through the pipeline.|`null`|\r\n|`maxSize`|The maximum number of events in a single batch. The sink will be flushed immediately when this limit is hit.|`100`|\r\n|`period`|The interval for autmoatic flushing of batches, in seconds.|`10`|\r\n","maintainers":[{"name":"ashleydavis","email":"ashley@codecapers.com.au"},{"name":"nblumhardt","email":"nblumhardt@nblumhardt.com"},{"name":"wedvich","email":"wedvich@gmail.com"}],"time":{"modified":"2022-06-27T01:22:39.745Z","created":"2015-07-20T01:23:45.354Z","0.0.2":"2015-07-20T01:23:45.354Z","0.0.3":"2015-07-21T00:59:20.582Z","0.0.4":"2015-07-21T01:08:41.249Z","0.0.5":"2015-07-22T03:59:26.068Z","0.0.13":"2015-08-25T08:12:53.534Z","0.0.14":"2015-09-04T02:12:04.471Z","0.0.15":"2015-10-26T00:58:34.536Z","0.0.16":"2015-10-26T03:47:15.428Z","0.0.18":"2015-11-02T00:25:21.379Z","0.1.0":"2017-01-17T19:55:24.293Z","0.2.0":"2017-09-26T20:29:22.155Z"},"homepage":"https://github.com/structured-log/structured-log#readme","keywords":["logging","structured","semantic","serilog"],"repository":{"type":"git","url":"git+https://github.com/structured-log/structured-log.git"},"author":{"name":"structured-log Contributors"},"bugs":{"url":"https://github.com/structured-log/structured-log/issues"},"license":"Apache-2.0","readmeFilename":"README.md","users":{"nelak":true}}