I have project on scala. I use this lib for logging https://github.com/typesafehub/scala-logging
i create logger
import com.typesafe.scalalogging.Logger
val log = Logger(getClass)
and two markers
import org.slf4j.{Marker, MarkerFactory}
private val marker: Marker = MarkerFactory.getMarker("DP")
private val marker2: Marker = MarkerFactory.getMarker("ST")
I use log in my controller
log.debug(marker, "----"
log.debug(marker2, "++++")
This is my logback
<appender name="STDOUTTime" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%coloredLevel %logger{30} - %marker - %d{yyyy/MM/dd/HH:mm:ss.SSS/Z} - %message%n%xException{3}</pattern>
</encoder>
<turboFilter class="ch.qos.logback.classic.turbo.MarkerFilter">
<Marker>DP</Marker>
<OnMatch>DENY</OnMatch>
<OnMismatch>DENY</OnMismatch>
</turboFilter>
<turboFilter class="ch.qos.logback.classic.turbo.MarkerFilter">
<Marker>ST</Marker>
<onMatch>DENY</onMatch>
<onMismatch>DENY</onMismatch>
</turboFilter>
</appender>
<logger name="ds.forwarding" level="DEBUG">
<appender-ref ref="STDOUTTime"/>
</logger>
<root level="ERROR">
</root>
now when i run my controller i have output in console:
[debug] d.f.c.a.s.InputStatisticController - DP - 2017/09/25/11:55:58.603/+0300 - ----
[debug] d.f.c.a.s.InputStatisticController - ST - 2017/09/25/11:55:58.603/+0300 - ++++
Now I have a questions:
- Why marker and marker2 is visible, why DENY does not work?
- How can I exclude two markers?
- How can I exclude only one marker?