cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Sentry logging implementation

Former Member
0 Likes
1,108

Hi ,

1 ) I added the dependency for external-dependecies.xml according to the operations on https://docs.sentry.io/clients/java/modules/log4j2/

2 ) After adding the related jars came under external libraries

3 ) added Java System Properties -Dsentry.dsn=https://e8e249ec5fe742f18b40d9a8651a4e87@sentry.io/1202345

4 ) and finally homepagecontroller add try catch block try { int a = 42 / 0; } catch (ArithmeticException e) { LOG.error(e.getMessage()); LOG.debug(e.getMessage()); }

5 ) but Sentry file doesnt send log to Sentry

Accepted Solutions (0)

Answers (1)

Answers (1)

liu_chun_yin
Explorer
0 Likes

i am working on integrate sentry to hybris 1811, after some work, seems work with below approach

1

put sentry jar sentry-1.7.16.jar sentry-log4j2-1.7.16.jar

to your module lib folder like {your-ext}{your-module}\lib

2

place sentry.properties to your module resource folder, {your-ext}{your-module}\resource

3

add below sentry log4j2 property to local.property

 log4j2.packages=org.apache.logging.log4j.core,io.sentry.log4j2
 log4j2.appender.sentry.type = Sentry
 log4j2.appender.sentry.name = Sentry
 log4j2.appender.sentry.filter.threshold.type = ThresholdFilter
 log4j2.appender.sentry.filter.threshold.level = warn
 log4j2.rootLogger.appenderRef.sentry.ref = Sentry