Skip to content

Commit 7bb8046

Browse files
committed
Capture stack trace in additionalData struct
1 parent 480d1bf commit 7bb8046

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

models/SentryAppender.cfc

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,16 @@ component extends="coldbox.system.logging.AbstractAppender" accessors=true {
4848
"detail"
4949
)
5050
) {
51+
var additionalData = {};
52+
if ( extraInfo.keyExists( "StackTrace" ) ) {
53+
additionalData.stacktrace = extraInfo.StackTrace;
54+
}
5155
getProperty( "sentryService" ).captureException(
52-
exception = extraInfo,
53-
level = level,
54-
message = message,
55-
logger = loggerCat
56+
exception = extraInfo,
57+
level = level,
58+
message = message,
59+
logger = loggerCat,
60+
additionalData = additionalData
5661
);
5762
} else if (
5863
( isStruct( extraInfo ) || isObject( extraInfo ) )
@@ -62,6 +67,9 @@ component extends="coldbox.system.logging.AbstractAppender" accessors=true {
6267
) {
6368
var trimmedExtra = structCopy( extraInfo );
6469
trimmedExtra.delete( "exception" );
70+
if ( extraInfo.exception.keyExists( "StackTrace" ) ) {
71+
trimmedExtra.stacktrace = extraInfo.exception.StackTrace;
72+
}
6573

6674
getProperty( "sentryService" ).captureException(
6775
exception = extraInfo.exception,

0 commit comments

Comments
 (0)