{"_id":"@opentelemetry/winston-transport@0.32.0","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js-contrib/issues"},"dist":{"shasum":"6ff17737170d625b274ac7164777d2fc28fec845","tarball":"http://registry-npm.ywwl.com/@opentelemetry/winston-transport/download/@opentelemetry/winston-transport-0.32.0.tgz","fileCount":15,"integrity":"sha512-TnGek6c90hbcrzW5jcSvdNcyicl7KChEETJak9sHz+pExwS5jbnBLNSNe6Q0agNZzY0FDj3ozz5//91bsd4ZUA==","signatures":[{"sig":"MEUCIHHlelPpcxCAWvIVCVVPeZXXNyWUM6E7ZFx+jZtcYHoRAiEAtcZSc9mufB2AUTUMrjhPppUhM4APC/ULm7R9J5sLQqw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFgDJIfIEngruPPVdB+XQ5AML0tXEWf6G4d87YZyPUFmAiEAkHbDnh9t1nA3/dUVpVHJYonTBj7zJMDs/Mtxrctk98w="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@opentelemetry%2fwinston-transport@0.32.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":48866,"size":13092,"noattachment":false,"key":"/@opentelemetry/winston-transport/-/@opentelemetry/winston-transport-0.32.0.tgz"},"main":"build/src/index.js","name":"@opentelemetry/winston-transport","types":"build/src/index.d.ts","author":{"name":"OpenTelemetry Authors"},"engines":{"node":"^18.19.0 || >=20.6.0"},"gitHead":"932fc967b142a8eb47d306fe92107b62962099f0","license":"Apache-2.0","scripts":{"tdd":"npm run test -- --watch-extensions ts --watch","test":"nyc mocha 'test/**/*.test.ts'","clean":"rimraf build/*","compile":"tsc -p .","prepublishOnly":"npm run compile","version:update":"node ../../scripts/version-update.js","compile:with-dependencies":"nx run-many -t compile -p @opentelemetry/winston-transport"},"version":"0.32.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:44e6ec25-25b6-4e08-9c1c-a7604802d1bf"}},"homepage":"https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/packages/winston-transport#readme","keywords":["transport","logging","nodejs","opentelemetry","winston"],"repository":{"url":"git+https://github.com/open-telemetry/opentelemetry-js-contrib.git","type":"git","directory":"packages/winston-transport"},"_npmVersion":"lerna/9.0.7/node@v24.19.0+x64 (linux)","description":"OpenTelemetry Transport for winston","directories":{},"maintainers":[{"name":"dyladan","email":"dyladan@gmail.com"},{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"},{"name":"overbalance","email":"overbalancedev@proton.me"},{"name":"npmjs-account","email":"npmjs-account@opentelemetry.io"},{"name":"trentm","email":"trentm@gmail.com"},{"name":"martinkuba","email":"martin@martinkuba.com"}],"_nodeVersion":"24.19.0","dependencies":{"winston-transport":"4.*","@opentelemetry/api-logs":"^0.222.0","@opentelemetry/semantic-conventions":"^1.41.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/triple-beam":"1.3.5","@opentelemetry/sdk-logs":"^0.222.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/winston-transport_0.32.0_1788208748803_0.02315241591346129"},"readme":"# OpenTelemetry transport for winston\n\n[![NPM Published Version][npm-img]][npm-url]\n[![Apache License][license-image]][license-image]\n\nThis module provides a Transport for [`winston`](https://www.npmjs.com/package/winston) module to send Winston logging to the OpenTelemetry Logging SDK.\n\nCompatible with OpenTelemetry JS API and SDK `1.0+`.\n\n## Installation\n\n```bash\nnpm install --save @opentelemetry/winston-transport\n```\n\n## Usage\n\nThis package exports the Winston transport class that is used to send records to the\nOpenTelemetry Logs SDK. It can be used directly when configuring a Winston logger. If using\n[`@opentelemetry/instrumenation-winston`](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/packages/instrumentation-winston)\npackage there is no need to instantiate the transport as the instrumentation will take care of that.\nFor example:\n\n```js\nconst logsAPI = require('@opentelemetry/api-logs');\nconst {\n    LoggerProvider,\n    SimpleLogRecordProcessor,\n    ConsoleLogRecordExporter,\n} = require('@opentelemetry/sdk-logs');\nconst { OpenTelemetryTransportV3 } = require('@opentelemetry/winston-transport');\nconst winston = require('winston');\n\n\n// To start a logger, you first need to initialize the Logger provider.\n// And add a processor to export log record.\nconst loggerProvider = new LoggerProvider({\n  processors: [\n    new SimpleLogRecordProcessor({ exporter: new ConsoleLogRecordExporter() })\n  ],\n});\nlogsAPI.logs.setGlobalLoggerProvider(loggerProvider);\n\nconst logger = winston.createLogger({\n  level: 'info',\n  transports: [\n    new winston.transports.Console(),\n    new OpenTelemetryTransportV3()\n  ]\n});\n```\n\n> [!IMPORTANT]\n> Logs will be duplicated if `@opentelemetry/winston-transport` is added as a transport in `winston` and `@opentelemetry/instrumentation-winston` is configured with `disableLogSending: false`.\n\n### Error handling\n\n`Error` instances assigned to the conventional `error` or `err` fields are\nemitted through the OpenTelemetry Logs API exception field. Instances assigned\nto other metadata fields, including errors nested in arrays or objects, are\nconverted to structured attributes containing their `name`, `message`, `stack`,\nand other own properties. Circular references in serialized error metadata are\nrepresented as `[Circular]`.\n\n### Supported versions\n\n- [`winston`](https://www.npmjs.com/package/winston) versions `>=3.0.0 <4`\n\n## Useful links\n\n- For more information on OpenTelemetry, visit: <https://opentelemetry.io/>\n- For more about OpenTelemetry JavaScript: <https://github.com/open-telemetry/opentelemetry-js>\n- For help or feedback on this project, join us in [GitHub Discussions][discussions-url]\n\n## License\n\nApache 2.0 - See [LICENSE][license-url] for more information.\n\n[discussions-url]: https://github.com/open-telemetry/opentelemetry-js/discussions\n[license-url]: https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/LICENSE\n[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat\n[npm-url]: https://www.npmjs.com/package/@opentelemetry/winston-transport\n[npm-img]: https://badge.fury.io/js/%40opentelemetry%2Fwinston-transport.svg\n","publish_time":1788208748901,"_cnpm_publish_time":1788208748901,"dist-tags":{"latest":"0.35.0"}}