Skip to content

Commit

Permalink
Send INFO to Console, TRACE to trace.log (#1173)
Browse files Browse the repository at this point in the history
  • Loading branch information
wcekan authored and aklish committed Jan 28, 2020
1 parent 04b1fce commit c726f1d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.slf4j.LoggerFactory;

import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.Logger;

import java.util.Arrays;
import java.util.HashMap;
Expand Down Expand Up @@ -139,9 +135,6 @@ public Class<?> lookupBoundClass(Class<?> objClass) {
dictionary.bindTrigger(Book.class, OnUpdatePreSecurity.class, onUpdateImmediateCallback, true);
dictionary.bindTrigger(Book.class, OnUpdatePostCommit.class, onUpdatePostCommitCallback, true);
dictionary.bindTrigger(Author.class, OnUpdatePostCommit.class, onUpdatePostCommitAuthor, true);
// enable trace
Logger rootLogger = (Logger) LoggerFactory.getILoggerFactory().getLogger(Logger.ROOT_LOGGER_NAME);
rootLogger.setLevel(Level.TRACE);
}

@BeforeEach
Expand Down
18 changes: 17 additions & 1 deletion elide-core/src/test/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,30 @@
-->
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<filter
class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>INFO</level>
</filter>
<encoder>
<pattern>%msg%n</pattern>
</encoder>
</appender>
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
<file>target/trace.log</file>
<append>false</append>
<encoder>
<pattern>%msg%n</pattern>
</encoder>
</appender>
<appender name="ASYNC" class="ch.qos.logback.classic.AsyncAppender">
<appender-ref ref="FILE" />
<neverBlock>true</neverBlock>
</appender>

<logger name="com.yahoo.elide.graphql" level="DEBUG" />
<logger name="com.yahoo.elide" level="TRACE" />

<root level="INFO">
<appender-ref ref="STDOUT" />
<appender-ref ref="ASYNC" />
</root>
</configuration>

0 comments on commit c726f1d

Please sign in to comment.