diff --git a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/JDBCDataSourceUtils.java b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/JDBCDataSourceUtils.java index 5e0c3d8309..97d295eb18 100644 --- a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/JDBCDataSourceUtils.java +++ b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/drivers/JDBCDataSourceUtils.java @@ -16,8 +16,8 @@ */ package org.apache.activemq.artemis.jdbc.store.drivers; +import org.apache.activemq.artemis.journal.ActiveMQJournalLogger; import org.apache.commons.beanutils.PropertyUtils; -import org.jboss.logging.Logger; import javax.sql.DataSource; import java.util.Map; @@ -25,13 +25,12 @@ import java.util.stream.Collectors; public class JDBCDataSourceUtils { - private static final Logger logger = Logger.getLogger(JDBCDataSourceUtils.class); - public static DataSource getDataSource(String dataSourceClassName, Map dataSourceProperties) { - logger.info(new StringBuilder("Initialising JDBC data source: ").append(dataSourceClassName).append(" ") - .append(dataSourceProperties.keySet().stream() - .map(key -> key + "=" + dataSourceProperties.get(key)) - .collect(Collectors.joining(", ", "{", "}")))); + ActiveMQJournalLogger.LOGGER.initializingJdbcDataSource(dataSourceClassName, dataSourceProperties + .keySet() + .stream() + .map(key -> key + "=" + dataSourceProperties.get(key)) + .collect(Collectors.joining(", ", "{", "}"))); try { DataSource dataSource = (DataSource) Class.forName(dataSourceClassName).newInstance(); for (Map.Entry entry : dataSourceProperties.entrySet()) { diff --git a/artemis-journal/src/main/java/org/apache/activemq/artemis/journal/ActiveMQJournalLogger.java b/artemis-journal/src/main/java/org/apache/activemq/artemis/journal/ActiveMQJournalLogger.java index 09513dbb08..fdd9eb1667 100644 --- a/artemis-journal/src/main/java/org/apache/activemq/artemis/journal/ActiveMQJournalLogger.java +++ b/artemis-journal/src/main/java/org/apache/activemq/artemis/journal/ActiveMQJournalLogger.java @@ -85,6 +85,10 @@ public interface ActiveMQJournalLogger extends BasicLogger { @Message(id = 141009, value = "A Free File is less than the maximum data", format = Message.Format.MESSAGE_FORMAT) void fileTooSmall(); + @LogMessage(level = Logger.Level.INFO) + @Message(id = 141010, value = "Initialising JDBC data source {0} with properties {1}", format = Message.Format.MESSAGE_FORMAT) + void initializingJdbcDataSource(String dataSourceClassName, String dataSourceProperties); + @LogMessage(level = Logger.Level.WARN) @Message(id = 142000, value = "You have a native library with a different version than expected", format = Message.Format.MESSAGE_FORMAT) void incompatibleNativeLibrary(); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java index 558d1785ca..5ff3e9c7f4 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java @@ -1739,13 +1739,12 @@ public class ConfigurationImpl implements Configuration, Serializable { sb.append("clustered=").append(isClustered()).append(","); if (isJDBC()) { DatabaseStorageConfiguration dsc = (DatabaseStorageConfiguration) getStoreConfiguration(); - sb.append("jdbcDriverClassName=").append(dsc.getJdbcDriverClassName()).append(","); - sb.append("jdbcConnectionUrl=").append(dsc.getJdbcConnectionUrl()).append(","); + sb.append("jdbcDriverClassName=").append(dsc.getDataSourceProperty("driverClassName")).append(","); + sb.append("jdbcConnectionUrl=").append(dsc.getDataSourceProperty("url")).append(","); sb.append("messageTableName=").append(dsc.getMessageTableName()).append(","); sb.append("bindingsTableName=").append(dsc.getBindingsTableName()).append(","); sb.append("largeMessageTableName=").append(dsc.getLargeMessageTableName()).append(","); sb.append("pageStoreTableName=").append(dsc.getPageStoreTableName()).append(","); - } else { sb.append("journalDirectory=").append(journalDirectory).append(","); sb.append("bindingsDirectory=").append(bindingsDirectory).append(",");