Page History
...
logback은 다양한 방법의 로그방식을 추가할수 있는 유용한 로그 라이브러리 입니다.
Code Block | ||||
---|---|---|---|---|
| ||||
#application.propertis logging.config=classpath:logback-spring.xml #application.conf akka { loggers = ["akka.event.Logging$DefaultLogger"] loglevel = "INFO" stdout-loglevel = "ERROR" } #logback-spring.xml <configuration> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <pattern>%date{ISO8601} %-5level %X{akkaSource} - %msg%n</pattern> </encoder> </appender> <root level="INFO"> <appender-ref ref="STDOUT" /> </root> </configuration> |
Step2.1 - 로그변경(Slf4jLogger)
Code Block | ||||
---|---|---|---|---|
| ||||
# application.conf akka { loggers = ["akka.event.slf4j.Slf4jLogger"] loglevel = "DEBUG" log-config-on-start = on } # pom.xml <dependency> <groupId>com.typesafe.akka</groupId> <artifactId>akka-slf4j_2.12</artifactId> <version>${akka.version}</version> </dependency> # logback-spring.xml <logger name="org.springframework.data" level="error" /> <logger name="akka" level="error" /> |
...
실행후 위 로그를 확인하였다면.. Spring과 Akka의 연합작전이 성공한것입니다.
참조:
- Akka+Spring : http://git.webnori.com/projects/WEBF/repos/spring_cachedb/commits/9a0b83d8a07cbe053dc20514546ac3fae05a8e23
- Akka Document : https://akka.io/
- Akka with Spring : https://www.baeldung.com/akka-with-spring