All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sklsft.commons.log.logback.ChannelConverter Maven / Gradle / Ivy

There is a newer version: 5.0.0-M1
Show newest version
package org.sklsft.commons.log.logback;

import org.sklsft.commons.api.context.RequestContext;
import org.sklsft.commons.api.context.RequestContextHolder;

import ch.qos.logback.classic.pattern.ClassicConverter;
import ch.qos.logback.classic.spi.ILoggingEvent;

public class ChannelConverter extends ClassicConverter {
	
	@Override
	public String convert(ILoggingEvent event) {
		
		RequestContext context = RequestContextHolder.getContextOrNull();
		
		if (context != null) {
			if (context.getChannel() != null) {
				return context.getChannel();
			}
		}
		return null;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy