Azure AppInsights for Apollo Server Logging
This package provides integration with Application Insights (part of Azure Monitor) for logging within Apollo Server.
Usage
Install the package to your project
npm install -d @aaronpowell/apollo-server-logger-appinsights
Create a resource in Azure, if required, and copy the Instrumentation Key.
Configure the logger on your Apollo instance:
import appInsightsLogger from "@aaronpowell/apollo-server-logger-appinsights";
const server = new ApolloServer({
typeDefs,
resolvers,
logger: appInsightsLogger(process.env.APP_INSIGHTS || ""),
});
Note: if you want to use your own TelemetryClient
for AppInsights, you can pass that into the appInsightsLogger
, rather than the instrumentation key.