1 /** 2 * LOGBack: the reliable, fast and flexible logging library for Java. 3 * 4 * Copyright (C) 1999-2006, QOS.ch 5 * 6 * This library is free software, you can redistribute it and/or 7 * modify it under the terms of the GNU Lesser General Public License as 8 * published by the Free Software Foundation. 9 */ 10 package ch.qos.logback.classic.pattern; 11 12 import ch.qos.logback.classic.spi.CallerData; 13 import ch.qos.logback.classic.spi.LoggingEvent; 14 15 public class ClassOfCallerConverter extends NamedConverter { 16 17 protected String getFullyQualifiedName(LoggingEvent event) { 18 19 CallerData[] cda = event.getCallerData(); 20 if (cda != null && cda.length > 0) { 21 return cda[0].getClassName(); 22 } else { 23 return CallerData.NA; 24 } 25 } 26 }