{"_id":"@apexlearning/log4js-node-marker","_rev":"2-96a557039024f6a6b912652e5355c743","name":"@apexlearning/log4js-node-marker","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@apexlearning/log4js-node-marker","version":"1.0.0","description":"Extend log4js-node to support associating named markers with logged messages","author":{"name":"Apex Learning Inc."},"license":"Apache-2.0","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://bitbucket.org/apexlearning/log4js-node-marker.git"},"main":"log4js-node-marker.js","types":"log4js-node-marker.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/debug":"^0.0.30","@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","marker"],"homepage":"https://bitbucket.org/apexlearning/log4js-node-marker#readme","_id":"@apexlearning/log4js-node-marker@1.0.0","_shasum":"9347b06419dec2226f5d0f4a40b65abac5cdb5de","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.2","_npmUser":{"name":"apexlearning-ci","email":"apex.ci@apexlearning.com"},"dist":{"shasum":"9347b06419dec2226f5d0f4a40b65abac5cdb5de","tarball":"https://registry.npmjs.org/@apexlearning/log4js-node-marker/-/log4js-node-marker-1.0.0.tgz","fileCount":7,"unpackedSize":45173,"integrity":"sha512-a2b42S/bHxGFp6wROUCTShMRhism4UkRjlTd1BvTPM9hWgdAberCRYNScbaumXFjpytpjoZMC7j35dOBDoH1jg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCnnC4+BxsKoibW7/Me3b3FgQqdwMKNoG5+spjcgCdNkQIhAL2d8tvomXIoWhCbVWhzNMULVu47gaso6xHRtGOaH6TD"}]},"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-marker_1.0.0_1531425133772_0.12006562910116703"},"_hasShrinkwrap":false}},"time":{"created":"2018-07-12T19:52:12.827Z","1.0.0":"2018-07-12T19:52:13.848Z","modified":"2022-06-12T14:43:37.518Z"},"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":"Extend log4js-node to support associating named markers with logged messages","homepage":"https://bitbucket.org/apexlearning/log4js-node-marker#readme","keywords":["logging","log","log4j","log4js","marker"],"repository":{"type":"git","url":"git+https://bitbucket.org/apexlearning/log4js-node-marker.git"},"author":{"name":"Apex Learning Inc."},"license":"Apache-2.0","readme":"# log4js-node-marker\n\nAn extension to [log4js-node][1] to associate special markers with log messages.\nIt's basically the log4js-node equivalent of [log4j Markers][3].\n\nAssociating markers with log messages are a convenient way of being able to perform\nlog message filtering, such as by using the MarkerSelector in combination with\n[log4js-node-selectorlayout][2].\n\n## Usage\n\nInstall the package as a dependency of your project\n\n    npm install --save log4js-node-marker\n\nNow you can log messages with markers as follows\n\n    const marker = SingletonMarkerContainer.getMarker('MyMarker');\n    const logger = log4js.getLogger();\n    logger.infoWithMarkers([marker], 'log message');\n\nIf you don't the look of the `LEVELWithMarkers` methods, a possible resolution is\nto write a wrapper type around log4js-node's `Logger` which calls the `LEVELWithMarkers`\nmethods behind the scenes. We chose not to override the signature of the normal\nlog4js-node `info`, `debug`, etc. methods to avoid breaking code that is already using\nlog4js-node but wants to start using markers.\n\n### MarkerSelector\n\nThis package also includes a selector compatible with [log4js-node-selectorlayout][2] called the MarkerSelector.\nTo use the selector, first add it to your log4js-node configuration. For example:\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 marker selector when you register the selector layout in your application.\nFor example:\n\n    const selectorRegistrations = {\n        'marker': markerSelectorFactory()\n    };\n    log4js.addLayout('selector', selectorLayoutRegistrar(selectorRegistrations));\n    log4js.configure(log4jsConfigObject);\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-selectorlayout/\n[3]: https://logging.apache.org/log4j/2.0/manual/markers.html","readmeFilename":"README.md"}