Platform:
IDE:
Build system:
Platform installed with:
I have the following issue:
When I configurated Sentry for log4j2, I met the following error messages on app boot:
2021-07-27 16:22:01,304 main ERROR Appenders contains an invalid element or attribute "Sentry"
2021-07-27 16:22:01,311 main ERROR Unable to locate appender "Sentry" for logger config "foobar"
My configs
log4j2.xml
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="warn" packages="org.apache.logging.log4j.core,io.sentry.log4j2">
<Properties>
<Property name="basePath">/var/log/foobar-app</Property>
<Property name="filename">system</Property>
</Properties>
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} %p %C: %m%n"/>
</Console>
<RollingFile name="FileLogger"
fileName="${basePath}/${filename}.log"
filePattern="${basePath}/${filename}.%d{yyyy-MM-dd}.log.gz">
<PatternLayout>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %p %C: %m%n</pattern>
</PatternLayout>
<Policies>
<SizeBasedTriggeringPolicy size="10MB"/>
</Policies>
<DefaultRolloverStrategy max="5"/>
</RollingFile>
<Sentry name="Sentry"/>
</Appenders>
<Loggers>
<Root level="INFO">
<AppenderRef ref="FileLogger"/>
</Root>
<Logger name="foobar" level="DEBUG" additivity="false">
<AppenderRef ref="Console"/>
<AppenderRef ref="FileLogger"/>
<AppenderRef ref="Sentry" level="WARN"/>
</Logger>
</Loggers>
</Configuration>
sentry.properties
dsn=https://6cfead8010c5c12200966a26cd9f62fd@sentry.my-company-domain.com/1
release=1.0
servername=dummy
stacktrace.app.packages=foobar
stacktrace.hidecommon=false
# Scale in milliseconds
timeout=10000
# In order to shutdown the buffer flushing thread gracefully, a ShutdownHook is created.
# Default shutdown time is 1000(milliseconds)
buffer.shutdowntimeout=5000
JVM startup options
java -Dlog4j.configurationFile=/home/lei/test-conf/log4j2.xml \
-Dsentry.properties.file=/home/lei/test-conf/sentry.properties \
...
NOTE: my Java code has not explicitly import the io.sentry package in any form.
Platform:
IDE:
Build system:
Platform installed with:
I have the following issue:
When I configurated Sentry for log4j2, I met the following error messages on app boot:
My configs
log4j2.xmlsentry.propertiesJVM startup options
java -Dlog4j.configurationFile=/home/lei/test-conf/log4j2.xml \ -Dsentry.properties.file=/home/lei/test-conf/sentry.properties \ ...NOTE: my Java code has not explicitly import the
io.sentrypackage in any form.