Collecting Application Logs Using Winston and OpenTelemetry
You can directly send logs of your application to SigNoz using Winston and OpenTelemetry Node.js libraries.
📝 Note
The default logging level can be configured.
To send all the logs to SigNoz please change the default log level to DEBUG.
const logger = winston.createLogger({
level: 'debug',
// ... other configurations
});
For SigNoz Cloud
For sending logs to SigNoz cloud, while running the above example set the below environment variables
The value of
OTEL_EXPORTER_OTLP_ENDPOINT
environment variable will behttps://ingest.{region}.signoz.cloud:443
where depending on the choice of your region for SigNoz cloud, the otlp endpoint will vary according to this table.Region Endpoint US ingest.us.signoz.cloud:443 IN ingest.in.signoz.cloud:443 EU ingest.eu.signoz.cloud:443 The value of
SIGNOZ_ACCESS_TOKEN
environment variable will be<SIGNOZ_INGESTION_KEY>
where<SIGNOZ_INGESTION_KEY>
is your ingestion key
Was this page helpful?
On this page