diff --git a/log4j-1.2-api/src/main/java/org/apache/log4j/Category.java b/log4j-1.2-api/src/main/java/org/apache/log4j/Category.java
index aae8850..cd0ed5c 100644
--- a/log4j-1.2-api/src/main/java/org/apache/log4j/Category.java
+++ b/log4j-1.2-api/src/main/java/org/apache/log4j/Category.java
@@ -25,6 +25,7 @@ import java.util.concurrent.ConcurrentMap;
 
 import org.apache.log4j.helpers.NullEnumeration;
 import org.apache.log4j.spi.LoggerFactory;
+import org.apache.log4j.spi.LoggerFactoryContexted;
 import org.apache.log4j.spi.LoggingEvent;
 import org.apache.logging.log4j.core.LoggerContext;
 import org.apache.logging.log4j.core.util.NameUtil;
@@ -39,7 +40,7 @@ import org.apache.logging.log4j.util.Strings;
  */
 public class Category {
 
-    private static LoggerFactory loggerFactory = new PrivateFactory();
+    private static LoggerFactoryContexted loggerFactory = new PrivateFactory();
 
     private static final Map<LoggerContext, ConcurrentMap<String, Logger>> CONTEXT_MAP =
         new WeakHashMap<>();
@@ -88,6 +89,17 @@ public class Category {
         if (logger != null) {
             return logger;
         }
+        logger = factory.makeNewLoggerInstance(name);
+        final Logger prev = loggers.putIfAbsent(name, logger);
+        return prev == null ? logger : prev;
+    }
+
+    static Logger getInstance(final LoggerContext context, final String name, final LoggerFactoryContexted factory) {
+        final ConcurrentMap<String, Logger> loggers = getLoggersMap(context);
+        Logger logger = loggers.get(name);
+        if (logger != null) {
+            return logger;
+        }
         logger = factory.makeNewLoggerInstance(context, name);
         final Logger prev = loggers.putIfAbsent(name, logger);
         return prev == null ? logger : prev;
@@ -444,10 +456,10 @@ public class Category {
     /**
      * Private logger factory.
      */
-    private static class PrivateFactory implements LoggerFactory {
+    private static class PrivateFactory implements LoggerFactoryContexted {
 
         @Override
-        public Logger makeNewLoggerInstance(final LoggerContext context, final String name) {
+        public Logger makeNewLoggerInstance(org.apache.logging.log4j.core.LoggerContext context, final String name) {
             return new Logger(context, name);
         }
     }
diff --git a/log4j-1.2-api/src/main/java/org/apache/log4j/spi/LoggerFactory.java b/log4j-1.2-api/src/main/java/org/apache/log4j/spi/LoggerFactory.java
index d79aea2..41e4345 100644
--- a/log4j-1.2-api/src/main/java/org/apache/log4j/spi/LoggerFactory.java
+++ b/log4j-1.2-api/src/main/java/org/apache/log4j/spi/LoggerFactory.java
@@ -27,6 +27,6 @@ import org.apache.log4j.Logger;
  */
 public interface LoggerFactory {
 
-  Logger makeNewLoggerInstance(org.apache.logging.log4j.core.LoggerContext context, String name);
+  Logger makeNewLoggerInstance(String name);
 
 }
diff --git a/log4j-1.2-api/src/main/java/org/apache/log4j/spi/LoggerFactoryContexted.java b/log4j-1.2-api/src/main/java/org/apache/log4j/spi/LoggerFactoryContexted.java
new file mode 100644
index 0000000..248cbe2
--- /dev/null
+++ b/log4j-1.2-api/src/main/java/org/apache/log4j/spi/LoggerFactoryContexted.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+package org.apache.log4j.spi;
+
+import org.apache.log4j.Logger;
+
+
+/**
+ *
+ * Implement this interface to create new instances of Logger or
+ * a sub-class of Logger when instantiating with specific context.
+ *
+ * <p>See <code>examples/subclass/MyLogger.java</code> for an example.
+ */
+public interface LoggerFactoryContexted
+{
+
+  Logger makeNewLoggerInstance(org.apache.logging.log4j.core.LoggerContext context, String name);
+
+}
