How to configure separate log files for same logger ?

Solution Unverified - Updated -

Issue

  • I have various datasource with spy tag enable to true like :
<datasources>
                <datasource jta="true" jndi-name="java:jboss/datasources/DB1" pool-name="DB1" enabled="true" use-java-context="true" spy="true">
                <datasource jta="true" jndi-name="java:jboss/datasources/DB2" pool-name="DB2" enabled="true" use-java-context="true" spy="true">
</datasources>

and "only one" logger for all informations from both Datasource:

            <periodic-rotating-file-handler name="JDBCLOG">
                    <formatter>
                         <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
                    </formatter>
                    <file relative-to="jboss.server.log.dir" path="jdbclog.log"/>
                    <suffix value=".yyyy-MM-dd"/>
                    <append value="true"/>
            </periodic-rotating-file-handler>

            <logger category="jboss.jdbc.spy" use-parent-handlers="false">
                    <level name="DEBUG"/>
                    <handlers>
                        <handler name="JDBCLOG"/>
                    </handlers>
            </logger>

How to configure separate log files for same logger i.e jdbclog_1.log for DB1 and jdbclog_2.log for DB2 ?

Environment

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

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.