Skip to content

Commit 4cbae28

Browse files
committed
#62 - Use AppLog.getLogger() rather than System.getLogger() to allow for customization
1 parent 07a44d4 commit 4cbae28

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

ebean-datasource-api/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313

1414
<dependencies>
1515

16+
<dependency>
17+
<groupId>io.avaje</groupId>
18+
<artifactId>avaje-applog</artifactId>
19+
<version>1.0</version>
20+
</dependency>
21+
1622
<dependency>
1723
<groupId>io.avaje</groupId>
1824
<artifactId>junit</artifactId>

ebean-datasource-api/src/main/java/io/ebean/datasource/PostgresInitDatabase.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package io.ebean.datasource;
22

3+
import io.avaje.applog.AppLog;
4+
35
import java.sql.Connection;
46
import java.sql.PreparedStatement;
57
import java.sql.SQLException;
@@ -9,7 +11,7 @@
911
*/
1012
public class PostgresInitDatabase implements InitDatabase {
1113

12-
private static final System.Logger log = System.getLogger("io.ebean.datasource");
14+
private static final System.Logger log = AppLog.getLogger("io.ebean.datasource");
1315

1416
@Override
1517
public void run(Connection connection, DataSourceConfig config) throws SQLException {

ebean-datasource-api/src/main/java/module-info.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module io.ebean.datasource.api {
22

33
requires transitive java.sql;
4+
requires transitive io.avaje.applog;
45

56
uses io.ebean.datasource.DataSourceFactory;
67

ebean-datasource/src/main/java/io/ebean/datasource/pool/Log.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
package io.ebean.datasource.pool;
22

3+
import io.avaje.applog.AppLog;
4+
35
import static java.lang.System.Logger.Level.*;
46

57
/**
68
* Common Logger instance for datasource implementation.
79
*/
810
final class Log {
911

10-
static final System.Logger log = System.getLogger("io.ebean.datasource");
12+
static final System.Logger log = AppLog.getLogger("io.ebean.datasource");
1113

1214
static void debug(String message, Object... params) {
1315
log.log(DEBUG, message, params);

0 commit comments

Comments
 (0)