{"_id":"@apexlearning/log4js-node-selectorlayout","_rev":"3-6976851d15d68fb32b8850d81f9236ad","name":"@apexlearning/log4js-node-selectorlayout","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"@apexlearning/log4js-node-selectorlayout","version":"1.0.0","description":"Configure log4js-node to write a log event to one of multiple different layouts by matching it against selector functions","author":{"name":"Apex Learning Inc."},"license":"Apache-2.0","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://bitbucket.org/apexlearning/log4js-node-selectorlayout.git"},"main":"log4js-node-selectorlayout.js","types":"log4js-node-selectorlayout.d.ts","scripts":{"gulp":"node $NODE_DEBUG_OPTION node_modules/gulp/bin/gulp.js --","clean":"npm run gulp clean","lint":"npm run gulp lint","test":"npm run gulp test","build":"npm run gulp build","dist":"npm run gulp dist"},"engines":{"node":">= 4.0"},"dependencies":{"@apexlearning/log4js-node-selectorlayout-selectortypings":"1.0.0"},"devDependencies":{"@types/gulp":"^3.0.0","@types/jasmine":"^2.8.4","@types/node":"^9.3.0","@types/vinyl":"^2.0.2","gulp":"^3.9.1","gulp-clean":"^0.4.0","gulp-jasmine":"^3.0.0","gulp-sourcemaps":"^2.6.3","gulp-tslint":"^8.1.2","gulp-typescript":"^4.0.1","jasmine":"^2.8.0","jasmine-spec-reporter":"~4.2.1","run-sequence":"^2.2.1","ts-node":"^7.0.0","tslint":"5.4.3","tslint-eslint-rules":"^4.0.0","typescript":"^2.6.2"},"keywords":["logging","log","log4j","log4js","selector","pattern","layout"],"homepage":"https://bitbucket.org/apexlearning/log4js-node-selectorlayout#readme","_id":"@apexlearning/log4js-node-selectorlayout@1.0.0","_shasum":"30c8774f3795d61055dd2b71accdd1f0b9af6218","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.2","_npmUser":{"name":"apexlearning-ci","email":"apex.ci@apexlearning.com"},"dist":{"shasum":"30c8774f3795d61055dd2b71accdd1f0b9af6218","tarball":"https://registry.npmjs.org/@apexlearning/log4js-node-selectorlayout/-/log4js-node-selectorlayout-1.0.0.tgz","fileCount":5,"unpackedSize":30436,"integrity":"sha512-GY1BJjvghZz1JAW0p5tr3zjJ4NY0DtNPyU96a3CzacxCkT9RXOhgc41BoRfYbkVQH6v0o52+9gTTf1lzV2G3dg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFyAbBnBuee3rPQJaQYtJfBfvE2qSFAGFOkpYv6pltHzAiBjyuqABurL3ic8JLc2U9kYIYiTj7M2uBTbov0ng2S7kQ=="}]},"maintainers":[{"name":"apexlearning-ci","email":"apex.ci@apexlearning.com"},{"name":"apexlearning-npm","email":"npm@apexlearning.com"},{"name":"apexlearning-winslow.dalpe","email":"winslow.dalpe@apexlearning.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/log4js-node-selectorlayout_1.0.0_1531336336041_0.6407334519198917"},"_hasShrinkwrap":false},"1.1.0":{"name":"@apexlearning/log4js-node-selectorlayout","version":"1.1.0","description":"Configure log4js-node to write a log event to one of multiple different layouts by matching it against selector functions","author":{"name":"Apex Learning Inc."},"license":"Apache-2.0","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://bitbucket.org/apexlearning/log4js-node-selectorlayout.git"},"main":"log4js-node-selectorlayout.js","types":"log4js-node-selectorlayout.d.ts","scripts":{"gulp":"node $NODE_DEBUG_OPTION node_modules/gulp/bin/gulp.js --","clean":"npm run gulp clean","lint":"npm run gulp lint","test":"npm run gulp test","build":"npm run gulp build","dist":"npm run gulp dist"},"engines":{"node":">= 4.0"},"dependencies":{"@apexlearning/log4js-node-selectorlayout-selectortypings":"1.0.0"},"peerDependencies":{"log4js":"^2.10.0"},"devDependencies":{"@types/gulp":"^3.0.0","@types/jasmine":"^2.8.4","@types/node":"^9.3.0","@types/vinyl":"^2.0.2","gulp":"^3.9.1","gulp-clean":"^0.4.0","gulp-jasmine":"^3.0.0","gulp-sourcemaps":"^2.6.3","gulp-tslint":"^8.1.2","gulp-typescript":"^4.0.1","jasmine":"^2.8.0","jasmine-spec-reporter":"~4.2.1","run-sequence":"^2.2.1","ts-node":"^7.0.0","tslint":"5.4.3","tslint-eslint-rules":"^4.0.0","typescript":"^2.6.2"},"keywords":["logging","log","log4j","log4js","selector","pattern","layout"],"homepage":"https://bitbucket.org/apexlearning/log4js-node-selectorlayout#readme","_id":"@apexlearning/log4js-node-selectorlayout@1.1.0","_shasum":"7fd8df00f12c1ba4b2973eb6b190a343b3deba95","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.2","_npmUser":{"name":"apexlearning-ci","email":"apex.ci@apexlearning.com"},"dist":{"shasum":"7fd8df00f12c1ba4b2973eb6b190a343b3deba95","tarball":"https://registry.npmjs.org/@apexlearning/log4js-node-selectorlayout/-/log4js-node-selectorlayout-1.1.0.tgz","fileCount":5,"unpackedSize":30497,"integrity":"sha512-DwRrwiORpmBua7BW4Br7hNirp+xM+sUzfcw5vi1jZC2Gb398QJRIbK280aIlw+jajNjfwi83/WpL12vWI2quFQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIENEMhcTi8Sprbv+Fup2Y7tSTnZ29gU/QZvXjdDWhYTcAiAjuj0BOU65sDTX5fFYODxch8Vjh5fTXLKXR8nZ0FBz3A=="}]},"maintainers":[{"name":"apexlearning-ci","email":"apex.ci@apexlearning.com"},{"name":"apexlearning-npm","email":"npm@apexlearning.com"},{"name":"apexlearning-winslow.dalpe","email":"winslow.dalpe@apexlearning.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/log4js-node-selectorlayout_1.1.0_1531419691798_0.674976240596826"},"_hasShrinkwrap":false}},"time":{"created":"2018-07-11T19:12:15.790Z","1.0.0":"2018-07-11T19:12:16.138Z","modified":"2022-06-12T14:43:37.693Z","1.1.0":"2018-07-12T18:21:31.910Z"},"maintainers":[{"name":"apexlearning-ci","email":"apex.ci@apexlearning.com"},{"name":"apexlearning-npm","email":"npm@apexlearning.com"},{"name":"apexlearning-winslow.dalpe","email":"winslow.dalpe@apexlearning.com"}],"description":"Configure log4js-node to write a log event to one of multiple different layouts by matching it against selector functions","homepage":"https://bitbucket.org/apexlearning/log4js-node-selectorlayout#readme","keywords":["logging","log","log4j","log4js","selector","pattern","layout"],"repository":{"type":"git","url":"git+https://bitbucket.org/apexlearning/log4js-node-selectorlayout.git"},"author":{"name":"Apex Learning Inc."},"license":"Apache-2.0","readme":"# log4js-node-selectorlayout\n\nAn extension to [log4js-node][1] to log messages to one of multiple different\nlayouts by matching it against selector functions. It's basically the\nlog4js-node equivalent of [log4j Pattern Selectors][3].\n\nWhen you use the selector layout, whenever you log a message with log4js-node,\nthe message will be matched against a list of selectors. These selectors are\nessentially functions, which you can define yourself or import from packages\nlike [log4js-node-marker][2], which examine a message and determine if the selector matches the\nmessage. If the selector matches the message, the message will be logged using a\nlayout associated with that selector (which could be another selector layout).\n\nThis allows you finer control over the format of your log messages.\n\n## Usage\n\nInstall the package as a dependency of your project\n\n    npm install --save log4js-node-selectorlayout\n\nThen, add the selector layout configuration to your log4js-node configuration JSON.\nHere's an example using the MarkerSelector from [log4js-node-marker][2]. In this example, we want\nto log messages with a particular pattern by default, but if the message was logged\nwith a special marker named `JSON`, we assume the message data is a JSON object\nand we only want to log that JSON rather than apply the pattern.\n\n    {\n      \"options\": {\n        \"categories\": {\n          \"default\": {\n            \"appenders\": [ \"console\" ],\n            \"level\": \"info\"\n          }\n        },\n        \"appenders\": {\n          \"console\": {\n            \"type\": \"console\",\n            \"layout\": {\n              \"type\": \"selector\",\n              \"defaultLayout\": {\n                \"type\": \"pattern\",\n                \"pattern\": \"%[[%d] [%p] [%c]%] - %m\"\n              },\n              \"selectors\": [\n                {\n                  \"type\": \"marker\",\n                  \"matchMarkerName\": \"JSON\",\n                  \"layout\": {\n                    \"type\": \"pattern\",\n                    \"pattern\": \"%m\"\n                  }\n                }\n              ]\n            }\n          }\n        }\n      }\n    }\n\nNext, register the layout selector when you instantiate log4js-node in your application.\nFor example, again using the MarkerSelector from [log4js-node-marker][2]:\n\n    const selectorRegistrations = {\n        'marker': markerSelectorFactory()\n    };\n    log4js.addLayout('selector', selectorLayoutRegistrar(selectorRegistrations));\n    log4js.configure(log4jsConfigObject);\n\nNow use log4js-node like you normally would.\n\n## License Information\n\nCopyright 2018 Apex Learning Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n<http://www.apache.org/licenses/LICENSE-2.0>\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n[1]: https://github.com/log4js-node/log4js-node/\n[2]: https://bitbucket.org/apexlearning/log4js-node-marker/\n[3]: https://logging.apache.org/log4j/2.x/manual/layouts.html#Pattern_Selectors","readmeFilename":"README.md"}