Skip to main content

Logging

Two loggers, deliberately separate: The lib logger does not import the App Insights sink. The sink dynamically imports the Node-only applicationinsights package and is server-only; pulling it into a client-safe module would break the browser bundle. Every error, warn and info on the module logger routes to Application Insights when APPLICATIONINSIGHTS_CONNECTION_STRING is set.
console.* is an ESLint error in src/ outside test files. Ad-hoc logging is how personal data ends up in a log aggregator with no retention policy — and it bypasses correlation entirely.

Correlation

Server-side logs carry a correlation ID, so a single user action can be followed across the request, the service calls, and the outbound integration calls it triggered. When a customer reports “it failed at about eleven”, the correlation ID is what turns that into a trace.

Alerts

Application Insights alerts are wired per environment and documented in a dedicated playbook. The signals worth alerting on:

Health checks

A health endpoint reports application and dependency status. The deployment pipeline waits for it before considering a release complete, and the platform monitor polls it continuously.

The observability dashboard

An in-product surface shows recent errors and operational state to administrators without server-log access. SYSTEM_ADMIN holds it — it is technical operation, and it is deliberately one of the few surfaces that role can reach. A separate read-only mailbox diagnostic reports Graph credential drift, an unconfigured mailbox, or an outage, with all values masked. Administrators can triage the most common integration failure themselves.

Audit versus logs

Different systems for different questions: Audit entries are masked and permanent; logs are detailed and retained per policy. Do not use logs as an audit trail — they are not designed to be one.

Capacity

Capacity planning has its own playbook: what to watch, what to scale, and in what order. The usual first mover is the App Service plan; the database follows.