Error: Missing required option: `apiKey`
dabelega opened this issue · comments
dabelega commented
I get this error: Error: Missing required option: apiKey
when I initialize the library. Here's what I'm doing.
import winston from 'winston';
import DatadogWinston from 'datadog-winston';
const logger = winston.createLogger({
format: winston.format.json(),
level: 'trace',
});
logger.add(
new DatadogWinston({
apiKey: DATADOG_API_KEY,
service: 'client-service',
}),
);
Nikhil Fadnis commented
@dhaniboy09 you're probably not passing a valid apiKey
on initialization. Fix that and you should be good to go 👍