Hi,

I have a simple Akka application based off of akka-sample-main-java template. 
I am trying to log into a log file rather than the STDOUT. The pom.xml has 
dependencies on akka-actor, akka-slf4j and logback-classic. The following 
are my application.conf and logback.xml. Both are placed in 
src/main/resources.

application.conf
akka {
  
  loggers = ["akka.event.slf4j.Slf4jLogger"]
stdout-loglevel = "OFF"
}

logback.xml

<configuration>

<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<!-- encoders are assigned the type 
ch.qos.logback.classic.encoder.PatternLayoutEncoder 
by default -->
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
</pattern>
</encoder>
</appender>

<appender name="FILE" class="ch.qos.logback.classic.sift.SiftingAppender">
<!-- Set the value via Mapped Diagnostic Context (MDC) in code. -->
<discriminator>
<key>logBasename</key>
<defaultValue>Test</defaultValue>
</discriminator>

<sift>
<appender name="FILE-${LogBasename}"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>log/application.log</fileNamePattern>
<maxHistory>30</maxHistory>
<timeBasedFileNamingAndTriggeringPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 5MB -->
<maxFileSize>5MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
</encoder>
</appender>
</sift>
</appender>

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

Even with STDOUT turned off in application.conf, the logs are shown in the 
console and not in the logs. In fact,, no logs are created.

Can some one help me with this, please?

Thanks!

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to