How to create a logger to send JBoss logging to Email using mail subsystem configuration?

Solution Verified - Updated -

Issue

  • How to create a mail logger for this configuration to log all outgoing emails?

    <subsystem xmlns="urn:jboss:domain:logging:1.3">            
            :
      <custom-handler name="PLATFORM_JDBC_LOGGER" class="com.sample.jdbclogger.JdbcLoggerHandler" module="com.sample.logger">
        <formatter>
          <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
        </formatter>
        <properties>
          <property name="jndiLookup" value="java:jboss/mail/Default"/>
          <property name="api" value="platform"/>
        </properties>
      </custom-handler>    
        :
    </subsystem>
    <subsystem xmlns="urn:jboss:domain:mail:1.1">
       <mail-session jndi-name="java:jboss/mail/Default">
          <smtp-server outbound-socket-binding-ref="mail-smtp"/>
       </mail-session>
    </subsystem>
    

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content