Maybe I was being lazy :-) but this change is mostly targeted to fixing/investigating LOG4J2-1419. I don't imagine many people would need this. I could be wrong... We can add this to the list of documented system properties to configure Log4j if you think it is generally useful.
On Mon, Jun 13, 2016 at 11:56 PM, Gary Gregory <garydgreg...@gmail.com> wrote: > Shouldn't this be documented? > > Gary > ---------- Forwarded message ---------- > From: <rpo...@apache.org> > Date: Jun 13, 2016 6:43 AM > Subject: logging-log4j2 git commit: LOG4J2-1419 added system properties > switch to enable locating where new LoggerContext is started > To: <comm...@logging.apache.org> > Cc: > > Repository: logging-log4j2 > Updated Branches: > refs/heads/master 6f7172c63 -> d1c907261 > > > LOG4J2-1419 added system properties switch to enable locating where new > LoggerContext is started > > > Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo > Commit: > http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/d1c90726 > Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/d1c90726 > Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/d1c90726 > > Branch: refs/heads/master > Commit: d1c907261127c69ef7ccda05cc8eb81e4b393528 > Parents: 6f7172c > Author: rpopma <rpo...@apache.org> > Authored: Mon Jun 13 22:43:13 2016 +0900 > Committer: rpopma <rpo...@apache.org> > Committed: Mon Jun 13 22:43:13 2016 +0900 > > ---------------------------------------------------------------------- > .../main/java/org/apache/logging/log4j/core/LoggerContext.java | 5 +++++ > 1 file changed, 5 insertions(+) > ---------------------------------------------------------------------- > > > > http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/d1c90726/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java > ---------------------------------------------------------------------- > diff --git > a/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java > b/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java > index fea1975..578a781 100644 > --- > a/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java > +++ > b/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java > @@ -45,6 +45,7 @@ import org.apache.logging.log4j.spi.AbstractLogger; > import org.apache.logging.log4j.spi.LoggerContextFactory; > import org.apache.logging.log4j.spi.LoggerRegistry; > import org.apache.logging.log4j.spi.Terminable; > +import org.apache.logging.log4j.util.PropertiesUtil; > > import static > org.apache.logging.log4j.core.util.ShutdownCallbackRegistry.*; > > @@ -205,6 +206,10 @@ public class LoggerContext extends AbstractLifeCycle > implements org.apache.loggi > @Override > public void start() { > LOGGER.debug("Starting LoggerContext[name={}, {}]...", getName(), > this); > + if > (PropertiesUtil.getProperties().getBooleanProperty("log4j.LoggerContext.trace.start", > false)) { > + LOGGER.debug("Stack trace to locate invoker", > + new Exception("Not a real error, showing stack trace > to locate invoker")); > + } > if (configLock.tryLock()) { > try { > if (this.isInitialized() || this.isStopped()) { > >