Skip to content
This repository was archived by the owner on Oct 31, 2024. It is now read-only.

Latest commit

 

History

History
29 lines (22 loc) · 834 Bytes

File metadata and controls

29 lines (22 loc) · 834 Bytes

Send Logs

Set up logging in your application

In order to see log information, you must instrument your application with a logger.
Add a logger when initializing the Aspecto telemetry:

const Instrument = require('@aspecto/opentelemetry');
Instrument({
    local: true,
    logger: myLogger
});

Then, configure your logger to collect logs for the levels you are interested in.
If your logger is initialized or changed later in your service lifecycle, you can also set the logger after initializing Aspecto, like this:

const Instrument = require('@aspecto/opentelemetry');
const { setLogger } = Instrument({ local: true });

 // initialize your service ...
 setLogger(myLogger); 

{% content-ref url="logs-correlation.md" %} logs-correlation.md {% endcontent-ref %}