{"_id":"@adarshmadrecha/node-loggly-bulk","_rev":"1-4f6de1c53cba959c905c7e7caeaaa879","name":"@adarshmadrecha/node-loggly-bulk","dist-tags":{"latest":"4.0.1"},"versions":{"4.0.1":{"name":"@adarshmadrecha/node-loggly-bulk","description":"A client implementation for Loggly cloud Logging-as-a-Service API","version":"4.0.1","author":{"name":"Adarsh Madrecha"},"repository":{"type":"git","url":"git+https://github.com/adarshmadrecha/node-loggly-bulk.git"},"keywords":["api","logging","loggly"],"dependencies":{"axios":"1.4.0","json-stringify-safe":"5.0.x"},"devDependencies":{"jest":"29.6.2"},"main":"./lib/loggly","scripts":{"lint":"eslint --max-warnings 0 --ext lib/**/*.js lib/*.js --fix","test":"jest"},"license":"MIT","engines":{"node":">= 16.0.0"},"bugs":{"url":"https://github.com/adarshmadrecha/node-loggly-bulk/issues"},"homepage":"https://github.com/adarshmadrecha/node-loggly-bulk#readme","directories":{"lib":"lib","test":"test"},"gitHead":"027dddabf9e0bf0b4ed5aaaa4cf6942bbff7b78a","_id":"@adarshmadrecha/node-loggly-bulk@4.0.1","_nodeVersion":"18.15.0","_npmVersion":"9.6.7","dist":{"integrity":"sha512-Vt7NVVfk1r8AHLMZrut8W4tjy5LBD1qW7vTgb4eOoXBw3Y9UlXeGmAEiuxlSFgZ1Cy9qsb3Bxv+bRfbZw9fnaw==","shasum":"703accdc180e0911d09c7554b3bd9bdbe4d6db3a","tarball":"https://registry.npmjs.org/@adarshmadrecha/node-loggly-bulk/-/node-loggly-bulk-4.0.1.tgz","fileCount":8,"unpackedSize":29630,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHEoi43CO+erZkwdpZcoVfBhqsWwhEEYDXa32J8qe1YmAiEAqXrDWf9vNJkWVYeUQ/iMxlRXheLpCAQ4FOhu5rC1/6w="}]},"_npmUser":{"name":"adarshmadrecha","email":"adarshmadrecha@yahoo.com"},"maintainers":[{"name":"adarshmadrecha","email":"adarshmadrecha@yahoo.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/node-loggly-bulk_4.0.1_1690708635181_0.4679202587930662"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."}},"time":{"created":"2023-07-30T09:17:15.120Z","4.0.1":"2023-07-30T09:17:15.389Z","modified":"2023-10-22T06:54:47.414Z"},"maintainers":[{"name":"adarshmadrecha","email":"adarshmadrecha@yahoo.com"}],"description":"A client implementation for Loggly cloud Logging-as-a-Service API","homepage":"https://github.com/adarshmadrecha/node-loggly-bulk#readme","keywords":["api","logging","loggly"],"repository":{"type":"git","url":"git+https://github.com/adarshmadrecha/node-loggly-bulk.git"},"author":{"name":"Adarsh Madrecha"},"bugs":{"url":"https://github.com/adarshmadrecha/node-loggly-bulk/issues"},"license":"MIT","readme":"# node-loggly-bulk\n\nℹ️ Forked from https://github.com/loggly/node-loggly-bulk\n\n[![Version npm](https://img.shields.io/npm/v/@adarshmadrecha/node-loggly-bulk.svg?style=flat-square)](https://www.npmjs.com/package/@adarshmadrecha/node-loggly-bulk) [![npm Downloads](https://img.shields.io/npm/dm/node-loggly-bulk.svg?style=flat-square)](https://www.npmjs.com/package/node-loggly-bulk)\n\n[![NPM](https://nodei.co/npm/@adarshmadrecha/node-loggly-bulk.png?downloads=true&downloadRank=true)](https://nodei.co/npm/@adarshmadrecha/node-loggly-bulk/)\n\nA client implementation for Loggly in node.js. Check out Loggly's [Node logging documentation](https://www.loggly.com/docs/nodejs-logs/) for more.\n\n## Usage\n\nThe `node-loggly-bulk` library is compliant with the [Loggly API][api]. Using `node-loggly-bulk` you can send logs to Loggly.\n\n### Getting Started\nBefore we can do anything with Loggly, we have to create a client with valid credentials. We will authenticate for you automatically:\n\n``` js\n  const loggly = require('@adarshmadrecha/node-loggly-bulk');\n\n  const client = loggly.createClient({\n    token: \"your-really-long-input-token\",\n    subdomain: \"your-subdomain\",\n    //\n    // Optional: Tag to send with EVERY log message\n    //\n    tags: ['global-tag']\n  });\n```\n\n### Logging\nThere are two ways to send log information to Loggly via node-loggly-bulk. The first is to simply call client.log with an appropriate input token:\n\n``` js\n  client.log('127.0.0.1 - Theres no place like home', function (err, result) {\n    // Do something once you've logged\n  });\n```\n\nNote that the callback in the above example is optional, if you prefer the 'fire and forget' method of logging:\n\n``` js\n  client.log('127.0.0.1 - Theres no place like home');\n```\n\n### Logging with Tags\n\nIf you're using Loggly's [tags](https://www.loggly.com/docs/tags/) functionality, simply include an array of tags as the second argument to the `log` method:\n\n``` js\n  client.log('127.0.0.1 - Theres no place like home', [ 'dorothy' ], function (err, result) {\n    // Do something once you've logged\n  });\n```\n\n*note* Tags passed into the log function will be merged with any global tags you may have defined.\n\n\n### Logging Shallow JSON Objects as a String\nIn addition to logging pure strings, it is also possible to pass shallow JSON object literals (i.e. no nested objects) to client.log(..) or input.log(..) methods, which will get converted into the [Loggly recommended string representation][sending-data]. So\n\n``` js\n  const source = {\n    foo: 1,\n    bar: 2,\n    buzz: 3\n  };\n\n  input.log(source);\n```\n\nwill be logged as:\n\n```\n  foo=1,bar=2,buzz=3\n```\n\n### Logging JSON Objects\nIt is also possible to log complex objects using the new JSON capabilities of Loggly. To enable JSON functionality in the client simply add 'json: true' to the configuration:\n\n``` js\n  const config = {\n    token: 'token',\n    subdomain: \"your-subdomain\",\n    json: true\n  };\n```\n\nWhen the json flag is enabled, objects will be converted to JSON using JSON.stringify before being transmitted to Loggly. So\n\n``` js\n  const source = {\n    foo: 1,\n    bar: 2,\n    buzz: {\n      sheep: 'jumped',\n      times: 10\n    }\n  };\n\n  input.log(source);\n```\n\nwill be logged as:\n\n``` json\n  { \"foo\": 1, \"bar\": 2, \"buzz\": {\"sheep\": \"jumped\", \"times\": 10 }}\n```\n\n### Logging arrays\nIt is possible to send arrays, which will result in one single request to Loggly.\n\n``` js\n  input.log([ {iam:'number 1'}, {iam:'number 2'} ])\n```\n\n## Installation\n\n### using npm\n``` bash\n  npm install @adarshmadrecha/node-loggly-bulk\n```\n### using pnpm\n``` bash\n  pnpm add @adarshmadrecha/node-loggly-bulk\n```\n\n## Run Tests\n\n``` bash\n  $ npm run test\n```\n\n\n#### Contributors: [Charlie Robbins](http://www.github.com/indexzero), [Marak Squires](http://github.com/marak), [hij1nx](http://github.com/hij1nx), [Kord Campbell](http://loggly.com), [Erik Hedenström](http://github.com/ehedenst),\n\n[api]: http://www.loggly.com/docs/api-overview/\n[sending-data]: http://www.loggly.com/docs/api-sending-data/\n[search-api]: http://www.loggly.com/docs/api-retrieving-data/\n[search]: http://www.loggly.com/docs/search-overview/\n[vows]: http://vowsjs.org\n","readmeFilename":"README.md"}