Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

テスト用のLoggerをLogbackに変更 #119

Merged
merged 3 commits into from
Jan 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 4 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,12 @@ Apache License verion 2.0
</dependency>
```

2. Add dependency for Logging library. Example Log4j.
2. Add dependency for Logging library. Example Logback.
```xml
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.1</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.10</version>
</dependency>
```

Expand Down
16 changes: 5 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ XlsMapper is Java Library for mapping Excel sheets to POJO.
<properties>
<java.version>1.8</java.version>
<poi.version>5.1.0</poi.version>
<slf4j.version>1.7.1</slf4j.version>
<slf4j.version>1.7.32</slf4j.version>
<jacoco.include.package>com.gh.mygreen.xlsmapper.*</jacoco.include.package>

<!-- SonarQubeの解析から除外したいファイル -->
Expand Down Expand Up @@ -394,23 +394,17 @@ $(document).ready(function() {
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.10</version>
<scope>test</scope>
</dependency>

<!-- 式言語 -->
<dependency>
<groupId>ognl</groupId>
<artifactId>ognl</artifactId>
<version>3.0.8</version>
<version>3.0.21</version>
</dependency>

<dependency>
Expand Down
13 changes: 4 additions & 9 deletions src/site/sphinx/source/howtouse.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,12 @@ Mavenを使用する場合は *pom.xml* に以下の記述を追加してくだ

.. sourcecode:: xml
:linenos:
:caption: ロギングライブラリの実装の追加(Log4jの場合
:caption: ロギングライブラリの実装の追加(Logbackの場合

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.1</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.10</version>
</dependency>


Expand Down
24 changes: 0 additions & 24 deletions src/test/resources/log4j.xml

This file was deleted.

18 changes: 18 additions & 0 deletions src/test/resources/logback.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<Pattern>.%d{HH:mm:ss.SSS} [%thread] %-5level %logger{15} - %msg %n</Pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>TRACE</level>
</filter>
</appender>
<logger name="com.gh.mygreen.xlsmapper" level="DEBUG">
<appender-ref ref="CONSOLE" />
</logger>
<root>
<level value="WARN" />
<appender-ref ref="CONSOLE" />
</root>
</configuration>