I am trying to make a logical call direct to different output levels in different places. I want all the logs to always access the file, but only INFO and above to go to the console. Is it impossible? I have the following and it will not work. Both are always the same:
def bySecond = timestamp("yyyyMMdd'.'HHmmss", context.birthTime) appender("STDOUT", ConsoleAppender) { encoder(PatternLayoutEncoder) { pattern = "%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n" } } appender("FILE", FileAppender) { file = "./logs/log-${bySecond}.log" encoder(PatternLayoutEncoder) { pattern = "%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n" } } logger("com.crystal", WARN, ["STDOUT"]) logger("com.crystal", TRACE, ["FILE"]) root(TRACE) scan()
Is it possible to send the same journal message to two different places based on different levels?
source share