[logback-user] LocLoggers and TurboFilters

Dario Campagna campagna at esteco.com
Sun Jun 10 11:21:35 CEST 2012

Hi Ceki,

> Could you provide a code sample of how you invoke a LocLogger with a marker?

Sure! The following class shows how I use a LocLogger to generate a logging request with a marker.

public class LocLoggerTest {

	public static void main(String[] args) {

		IMessageConveyor mc = new MessageConveyor(Locale.getDefault());
		LocLoggerFactory llFactory_default = new LocLoggerFactory(mc);
		LocLogger locLogger = llFactory_default.getLocLogger("defaultLocLogger");
		Marker alwaysMarker = MarkerFactory.getMarker("ALWAYS");
		locLogger.info(alwaysMarker,"This will always appear.");


A simple configuration file to test it is

<configuration debug="true">

	<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
			<pattern>%level - %date - %marker - %msg%n</pattern>
	<turboFilter class="ch.qos.logback.classic.turbo.MarkerFilter">
	<logger name="defaultLocLogger" level="INFO">
		<appender-ref ref="STDOUT" />


When I change the logger level to a value grater than INFO, the logging request marked ALWAYS is not enabled.


More information about the Logback-user mailing list