Multiple Appenders

Hi All,
I am using Sentry in java. The logback.xml is updated as

        <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
                <encoder>
                  <pattern>msg</pattern>
                </encoder>
        </appender>
          
        <appender name="Sentry" class="com.getsentry.raven.logback.SentryAppender">
        		<dsn>https://xxx:xxx@sentry.io/xxx</dsn>
           </appender>
          <root level="error">
        	    <appender-ref ref="Sentry"/>
                    <appender-ref ref="STDOUT"/>
          </root>

The issue with the above setting is that when we use both the appenders in <root> the sentry will not be logged and no error is mailed to the sentry. If the <appender-ref ref="STDOUT"/> is commented then the sentry works as expected - The logs are sent to the sentry and we have the mail sent with the log.

Can I get any work around or please point out the mistake.

I’m not seeing anything wrong with your conversation (although I don’t think the <pattern> is what you’d actually want to use) and couldn’t replicate your issue when using our logback example and your configuration.

Using the default rule configuration, you’ll only get emailed on the first occurrence of an issue — not on every error. Are you sure this isn’t what you’re observing?

hi @tkaemming for pattern I use <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern> .

logback example still works as the same , The STDOUT is not used if sentry is added. Will be responding again when i get the issue fixed . Thanks for the response :slight_smile: