feat(CF-2136): Add Sentry structured logging support
Enable Sentry.logger API (enableLogs, beforeSendLog) and add logInfo/logWarn/logError helpers. Bump @sentry/node ^9.47.1 → ^10.39.0, @sentry/profiling-node → ^10.39.0. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1537
package-lock.json
generated
1537
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -12,8 +12,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@modelcontextprotocol/sdk": "^1.0.4",
|
||||
"@sentry/node": "^9.47.1",
|
||||
"@sentry/profiling-node": "^10.37.0",
|
||||
"@sentry/node": "^10.39.0",
|
||||
"@sentry/profiling-node": "^10.39.0",
|
||||
"dotenv": "^17.2.3",
|
||||
"pg": "^8.11.3"
|
||||
},
|
||||
|
||||
@@ -70,6 +70,11 @@ export function initSentry(environment: string = "development"): void {
|
||||
|
||||
return event;
|
||||
},
|
||||
enableLogs: true,
|
||||
beforeSendLog(log) {
|
||||
if (log.level === "debug") return null;
|
||||
return log;
|
||||
},
|
||||
maxBreadcrumbs: 30,
|
||||
attachStacktrace: true,
|
||||
release: process.env.APP_VERSION || "unknown",
|
||||
@@ -81,6 +86,18 @@ export function initSentry(environment: string = "development"): void {
|
||||
);
|
||||
}
|
||||
|
||||
export function logInfo(msg: string, data?: Record<string, unknown>): void {
|
||||
Sentry.logger.info(msg, data);
|
||||
}
|
||||
|
||||
export function logWarn(msg: string, data?: Record<string, unknown>): void {
|
||||
Sentry.logger.warn(msg, data);
|
||||
}
|
||||
|
||||
export function logError(msg: string, data?: Record<string, unknown>): void {
|
||||
Sentry.logger.error(msg, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrap MCP tool handler with Sentry transaction tracking.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user