AbstractLoggingActorを拡張してアクターを実装しました。しかし、どういうわけかakkaログはコンソールにのみ書き出され、ログファイルには書き込まれず、エラーはスローされません。AbstractLoggingActorはFile Appenderへの書き込みではなく、Java Akkaのコンソールへの書き込み
実際のakkaバージョンと同じバージョンのakka-slf4jを使用していますが、ヘルプはありません。私は最初に使用した元のpom configsを添付しています。
logback.xml
<appender name="fileAppender" class="ch.qos.logback.core.FileAppender">
<file>/opt/Corp-Async-Job-Processor/logs/corp-job-akka-framework.log</file>
<append>true</append>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>info</level>
</filter>
<encoder>
<pattern>%date{ISO8601} - %logger -> %-5level[%thread] %logger{0} - %msg%n</pattern>
</encoder>
</appender>
<!--appender name="Sentry" class="io.sentry.logback.SentryAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>INFO</level>
</filter>
</appender-->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>debug</level>
</filter>
<encoder>
<pattern>%date{ISO8601} - %logger -> %-5level[%thread] %logger{0} - %msg%n</pattern>
</encoder>
</appender>
<logger name="akka" level="debug" />
<logger name="com.packt" level="debug"/>
<root level="TRACE">
<appender-ref ref="fileAppender"/>
<appender-ref ref="console"/>
</root>
application.conf:モジュールののpom.xmlで
akka {
loglevel = "DEBUG"
event-handlers = ["akka.event.slf4j.Slf4jEventHandler"]
}
依存性:プロジェクトの
<dependencies>
<dependency>
<groupId>com.github.davidmoten</groupId>
<artifactId>rxjava-jdbc</artifactId>
<version>0.7.6</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.davidmoten</groupId>
<artifactId>rxjava-jdbc</artifactId>
<version>0.7.6</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.3</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>${logback.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.3.11.RELEASE</version>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-http_${artifact.id.version}</artifactId>
<version>${akka.http.version}</version>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-http-jackson_${artifact.id.version}</artifactId>
<version>${akka.http.version}</version>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-stream_${artifact.id.version}</artifactId>
<version>${akka.version}</version>
</dependency>
<dependency>
<groupId>org.xhtmlrenderer</groupId>
<artifactId>flying-saucer-pdf</artifactId>
<version>9.1.9</version>
</dependency>
<!--dependency>
<groupId>de.idyl</groupId>
<artifactId>winzipaes</artifactId>
<version>1.0.1</version>
</dependency-->
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-http-testkit_${artifact.id.version}
</artifactId>
<version>${akka.http.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-s3</artifactId>
<version>1.11.232</version>
</dependency>
<dependency>
<groupId>net.lingala.zip4j</groupId>
<artifactId>zip4j</artifactId>
<version>1.3.2</version>
</dependency>
</dependencies>
のpom.xml :
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<akka.version>2.5.4</akka.version>
<artifact.id.version>2.12</artifact.id.version>
<akka.http.version>10.0.10</akka.http.version>
<mysql.version>6.0.5</mysql.version>
<slf4j.version>1.6.6</slf4j.version>
<logback.version>1.0.7</logback.version>
</properties>
<dependencies>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.1</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-annotations -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.9.1</version>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-actor_${artifact.id.version}</artifactId>
<version>${akka.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.3.11.RELEASE</version>
</dependency>
</dependencies>
しかし、ファイルのログにも、エラーメッセージを取得しておりません。 – user3828976