Here is my pom.xml for logging:

<dependency>
    <groupId>log4j</groupId>
    <artifactId>log4j</artifactId>
    <version>1.2.16</version>
</dependency>
<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-log4j12</artifactId>
    <version>1.5.11</version>
</dependency>
<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-api</artifactId>
    <version>1.5.11</version>
</dependency>
<dependency>
    <groupId>org.apache.logging.log4j</groupId>
    <artifactId>log4j-api</artifactId>
    <version>2.3</version>
</dependency>
<dependency>
    <groupId>org.apache.logging.log4j</groupId>
    <artifactId>log4j-core</artifactId>
    <version>2.3</version>
</dependency>
<dependency>
    <groupId>org.apache.logging.log4j</groupId>
    <artifactId>log4j-web</artifactId>
    <version>2.3</version>
</dependency>
<dependency>
    <groupId>com.lmax</groupId>
    <artifactId>disruptor</artifactId>
    <version>3.2.0</version>
</dependency>


On Tue, Oct 13, 2015 at 12:22 PM, Remko Popma <remko.po...@gmail.com> wrote:

> For log4j1, are you using the log4j-1.2-api-2.x.jar? And similarly the
> log4j-slf4j-impl-2.x.jar for SLF4J? (Just checking...)
>
> Sent from my iPhone
>
> > On 2015/10/13, at 11:43, Gary Gregory <garydgreg...@gmail.com> wrote:
> >
> > Can you use 2.4?
> >
> > Gary
> >
> >> On Mon, Oct 12, 2015 at 6:56 PM, Strong Su <lovelo...@gmail.com> wrote:
> >>
> >> I'm using Log4j 2.3 and Disruptor 3.2.
> >> Because of third party package like spring, I have to use Log4j 1.2 and
> >> slf4j 1.5 too.
> >>
> >>
> >> On Tue, Oct 13, 2015 at 7:15 AM, Remko Popma <remko.po...@gmail.com>
> >> wrote:
> >>
> >>> Output looks ok.
> >>> Sleep was the default wait strategy but has been changed to Block a
> long
> >>> time ago. Looks like the docs are out of date. Thanks for drawing my
> >>> attention to this.
> >>>
> >>> I don't understand why changing the includeLocation does not make a
> >>> difference in performance. You should see a large improvement.
> >>> Which Log4j version are you using?
> >>>
> >>>
> >>>
> >>>> On Mon, Oct 12, 2015 at 12:58 PM, Strong Su <lovelo...@gmail.com>
> wrote:
> >>>>
> >>>> Here is my console debug with status="trace".
> >>>> I found that log4j2 didn't get SleepWaitingStrategy by default and I
> >>> didn't
> >>>> find includeLocation in console.
> >>>>
> >>>>
> >>>> 2015-10-12 18:55:25,424 DEBUG Starting LoggerContext[name=2090228673]
> >>> from
> >>>> configuration at jndi:/localhost/WEB-INF/log4j2.xml
> >>>> 2015-10-12 18:55:25,425 DEBUG Starting LoggerContext[name=2090228673,
> >>>> org.apache.logging.log4j.core.LoggerContext@4347ede7] with
> >> configuration
> >>>> XmlConfiguration[location=jndi:/localhost/WEB-INF/log4j2.xml]...
> >>>> 2015-10-12 18:55:25,427 DEBUG Shutdown hook enabled. Registering a new
> >>> one.
> >>>> 2015-10-12 18:55:25,430 DEBUG Starting configuration
> >>>> XmlConfiguration[location=jndi:/localhost/WEB-INF/log4j2.xml]
> >>>> 2015-10-12 18:55:25,432 DEBUG PluginManager 'Core' found 70 plugins
> >>>> 2015-10-12 18:55:25,433 DEBUG PluginManager 'Level' found 0 plugins
> >>>> 2015-10-12 18:55:25,438 DEBUG PluginManager 'Lookup' found 11 plugins
> >>>> 2015-10-12 18:55:25,441 DEBUG Building Plugin[name=layout,
> >>>> class=org.apache.logging.log4j.core.layout.PatternLayout]. Searching
> >> for
> >>>> builder factory method...
> >>>> 2015-10-12 18:55:25,445 DEBUG Found builder factory method
> >> [newBuilder]:
> >>>> public static
> >> org.apache.logging.log4j.core.layout.PatternLayout$Builder
> >>>> org.apache.logging.log4j.core.layout.PatternLayout.newBuilder().
> >>>> 2015-10-12 18:55:25,458 DEBUG TypeConverterRegistry initializing.
> >>>> 2015-10-12 18:55:25,458 DEBUG PluginManager 'TypeConverter' found 21
> >>>> plugins
> >>>> 2015-10-12 18:55:25,480 DEBUG Calling build() on class class
> >>>> org.apache.logging.log4j.core.layout.PatternLayout$Builder for element
> >>>> PatternLayout with params(name="%d %-5p [%c{2}] %m%n",
> >>>> Configuration(jndi:/localhost/WEB-INF/log4j2.xml), null, name="null",
> >>>> name="null", name="null", name="null", name="null")
> >>>> 2015-10-12 18:55:25,481 DEBUG PluginManager 'Converter' found 33
> >> plugins
> >>>> 2015-10-12 18:55:25,482 DEBUG Built Plugin[name=layout] OK from
> builder
> >>>> factory method.
> >>>> 2015-10-12 18:55:25,483 DEBUG Building Plugin[name=appender,
> >>>> class=org.apache.logging.log4j.core.appender.FileAppender]. Searching
> >> for
> >>>> builder factory method...
> >>>> 2015-10-12 18:55:25,485 DEBUG No builder factory method found in class
> >>>> org.apache.logging.log4j.core.appender.FileAppender. Going to try
> >>> finding a
> >>>> factory method instead.
> >>>> 2015-10-12 18:55:25,486 DEBUG Still building Plugin[name=appender,
> >>>> class=org.apache.logging.log4j.core.appender.FileAppender]. Searching
> >> for
> >>>> factory method...
> >>>> 2015-10-12 18:55:25,486 DEBUG Found factory method [createAppender]:
> >>> public
> >>>> static org.apache.logging.log4j.core.appender.FileAppender
> >>
> org.apache.logging.log4j.core.appender.FileAppender.createAppender(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,org.apache.logging.log4j.core.Layout,org.apache.logging.log4j.core.Filter,java.lang.String,java.lang.String,org.apache.logging.log4j.core.config.Configuration).
> >>>> 2015-10-12 18:55:25,500 DEBUG Calling createAppender on class
> >>>> org.apache.logging.log4j.core.appender.FileAppender for element File
> >> with
> >>>> params(name="/data/applogs/data-proxy/logs/app.log", name="false",
> >>>> name="null", name="File", name="false", name="null", name="null",
> >>>> name="null", PatternLayout(%d %-5p [%c{2}] %m%n), null, name="null",
> >>>> name="null", Configuration(jndi:/localhost/WEB-INF/log4j2.xml))
> >>>> 2015-10-12 18:55:25,504 DEBUG Starting FileManager
> >>>> /data/applogs/data-proxy/logs/app.log
> >>>> 2015-10-12 18:55:25,505 DEBUG Built Plugin[name=appender] OK from
> >> factory
> >>>> method.
> >>>> 2015-10-12 18:55:25,505 DEBUG Building Plugin[name=layout,
> >>>> class=org.apache.logging.log4j.core.layout.PatternLayout]. Searching
> >> for
> >>>> builder factory method...
> >>>> 2015-10-12 18:55:25,505 DEBUG Found builder factory method
> >> [newBuilder]:
> >>>> public static
> >> org.apache.logging.log4j.core.layout.PatternLayout$Builder
> >>>> org.apache.logging.log4j.core.layout.PatternLayout.newBuilder().
> >>>> 2015-10-12 18:55:25,507 DEBUG Calling build() on class class
> >>>> org.apache.logging.log4j.core.layout.PatternLayout$Builder for element
> >>>> PatternLayout with params(name="%d %-5p [%c{2}] %m%n",
> >>>> Configuration(jndi:/localhost/WEB-INF/log4j2.xml), null, name="null",
> >>>> name="null", name="null", name="null", name="null")
> >>>> 2015-10-12 18:55:25,508 DEBUG Built Plugin[name=layout] OK from
> builder
> >>>> factory method.
> >>>> 2015-10-12 18:55:25,508 DEBUG Building Plugin[name=appender,
> >>>> class=org.apache.logging.log4j.core.appender.ConsoleAppender].
> >> Searching
> >>>> for builder factory method...
> >>>> 2015-10-12 18:55:25,510 DEBUG PluginManager 'Converter' found 33
> >> plugins
> >>>> 2015-10-12 18:55:25,512 DEBUG Found builder factory method
> >> [newBuilder]:
> >>>> public static
> >>>> org.apache.logging.log4j.core.appender.ConsoleAppender$Builder
> >>>> org.apache.logging.log4j.core.appender.ConsoleAppender.newBuilder().
> >>>> 2015-10-12 18:55:25,519 DEBUG No PluginVisitorStrategy found on
> >>> annotation
> >>>> [interface
> >>
> org.apache.logging.log4j.core.config.plugins.validation.constraints.Required].
> >>>> Ignoring.
> >>>> 2015-10-12 18:55:25,520 DEBUG Encountered type
> >>>> [org.apache.logging.log4j.core.layout.PatternLayout] which can only be
> >>>> checked for null.
> >>>> 2015-10-12 18:55:25,522 DEBUG No PluginVisitorStrategy found on
> >>> annotation
> >>>> [interface
> >>
> org.apache.logging.log4j.core.config.plugins.validation.constraints.Required].
> >>>> Ignoring.
> >>>> 2015-10-12 18:55:25,523 DEBUG Encountered type
> >>>> [org.apache.logging.log4j.core.appender.ConsoleAppender$Target] which
> >> can
> >>>> only be checked for null.
> >>>> 2015-10-12 18:55:25,524 DEBUG No PluginVisitorStrategy found on
> >>> annotation
> >>>> [interface
> >>
> org.apache.logging.log4j.core.config.plugins.validation.constraints.Required].
> >>>> Ignoring.
> >>>> 2015-10-12 18:55:25,525 DEBUG Calling build() on class class
> >>>> org.apache.logging.log4j.core.appender.ConsoleAppender$Builder for
> >>> element
> >>>> Console with params(PatternLayout(%d %-5p [%c{2}] %m%n), null,
> >>>> name="SYSTEM_OUT", name="STDOUT", name="null", name="null")
> >>>> 2015-10-12 18:55:25,526 DEBUG Built Plugin[name=appender] OK from
> >> builder
> >>>> factory method.
> >>>> 2015-10-12 18:55:25,526 DEBUG Building Plugin[name=appenders,
> >>>> class=org.apache.logging.log4j.core.config.AppendersPlugin]. Searching
> >>> for
> >>>> builder factory method...
> >>>> 2015-10-12 18:55:25,527 DEBUG No builder factory method found in class
> >>>> org.apache.logging.log4j.core.config.AppendersPlugin. Going to try
> >>> finding
> >>>> a factory method instead.
> >>>> 2015-10-12 18:55:25,527 DEBUG Still building Plugin[name=appenders,
> >>>> class=org.apache.logging.log4j.core.config.AppendersPlugin]. Searching
> >>> for
> >>>> factory method...
> >>>> 2015-10-12 18:55:25,528 DEBUG Found factory method [createAppenders]:
> >>>> public static java.util.concurrent.ConcurrentMap
> >>
> org.apache.logging.log4j.core.config.AppendersPlugin.createAppenders(org.apache.logging.log4j.core.Appender[]).
> >>>> 2015-10-12 18:55:25,530 DEBUG Calling createAppenders on class
> >>>> org.apache.logging.log4j.core.config.AppendersPlugin for element
> >>> Appenders
> >>>> with params(={File, STDOUT})
> >>>> 2015-10-12 18:55:25,532 DEBUG Built Plugin[name=appenders] OK from
> >>> factory
> >>>> method.
> >>>> 2015-10-12 18:55:25,532 DEBUG Building Plugin[name=AppenderRef,
> >>>> class=org.apache.logging.log4j.core.config.AppenderRef]. Searching for
> >>>> builder factory method...
> >>>> 2015-10-12 18:55:25,534 DEBUG No builder factory method found in class
> >>>> org.apache.logging.log4j.core.config.AppenderRef. Going to try finding
> >> a
> >>>> factory method instead.
> >>>> 2015-10-12 18:55:25,535 DEBUG Still building Plugin[name=AppenderRef,
> >>>> class=org.apache.logging.log4j.core.config.AppenderRef]. Searching for
> >>>> factory method...
> >>>> 2015-10-12 18:55:25,536 DEBUG Found factory method
> [createAppenderRef]:
> >>>> public static org.apache.logging.log4j.core.config.AppenderRef
> >>
> org.apache.logging.log4j.core.config.AppenderRef.createAppenderRef(java.lang.String,org.apache.logging.log4j.Level,org.apache.logging.log4j.core.Filter).
> >>>> 2015-10-12 18:55:25,538 DEBUG Calling createAppenderRef on class
> >>>> org.apache.logging.log4j.core.config.AppenderRef for element
> >> AppenderRef
> >>>> with params(name="File", name="null", null)
> >>>> 2015-10-12 18:55:25,539 DEBUG Built Plugin[name=AppenderRef] OK from
> >>>> factory method.
> >>>> 2015-10-12 18:55:25,540 DEBUG Building Plugin[name=AppenderRef,
> >>>> class=org.apache.logging.log4j.core.config.AppenderRef]. Searching for
> >>>> builder factory method...
> >>>> 2015-10-12 18:55:25,540 DEBUG No builder factory method found in class
> >>>> org.apache.logging.log4j.core.config.AppenderRef. Going to try finding
> >> a
> >>>> factory method instead.
> >>>> 2015-10-12 18:55:25,541 DEBUG Still building Plugin[name=AppenderRef,
> >>>> class=org.apache.logging.log4j.core.config.AppenderRef]. Searching for
> >>>> factory method...
> >>>> 2015-10-12 18:55:25,543 DEBUG Found factory method
> [createAppenderRef]:
> >>>> public static org.apache.logging.log4j.core.config.AppenderRef
> >>
> org.apache.logging.log4j.core.config.AppenderRef.createAppenderRef(java.lang.String,org.apache.logging.log4j.Level,org.apache.logging.log4j.core.Filter).
> >>>> 2015-10-12 18:55:25,546 DEBUG Calling createAppenderRef on class
> >>>> org.apache.logging.log4j.core.config.AppenderRef for element
> >> AppenderRef
> >>>> with params(name="STDOUT", name="null", null)
> >>>> 2015-10-12 18:55:25,547 DEBUG Built Plugin[name=AppenderRef] OK from
> >>>> factory method.
> >>>> 2015-10-12 18:55:25,548 DEBUG Building Plugin[name=asyncRoot,
> >> class=org.apache.logging.log4j.core.async.AsyncLoggerConfig$RootLogger].
> >>>> Searching for builder factory method...
> >>>> 2015-10-12 18:55:25,551 DEBUG No builder factory method found in class
> >>>> org.apache.logging.log4j.core.async.AsyncLoggerConfig$RootLogger.
> Going
> >>> to
> >>>> try finding a factory method instead.
> >>>> 2015-10-12 18:55:25,552 DEBUG Still building Plugin[name=asyncRoot,
> >> class=org.apache.logging.log4j.core.async.AsyncLoggerConfig$RootLogger].
> >>>> Searching for factory method...
> >>>> 2015-10-12 18:55:25,554 DEBUG Found factory method [createLogger]:
> >> public
> >>>> static org.apache.logging.log4j.core.config.LoggerConfig
> >>
> org.apache.logging.log4j.core.async.AsyncLoggerConfig$RootLogger.createLogger(java.lang.String,java.lang.String,java.lang.String,org.apache.logging.log4j.core.config.AppenderRef[],org.apache.logging.log4j.core.config.Property[],org.apache.logging.log4j.core.config.Configuration,org.apache.logging.log4j.core.Filter).
> >>>> 2015-10-12 18:55:25,559 DEBUG Calling createLogger on class
> >>>> org.apache.logging.log4j.core.async.AsyncLoggerConfig$RootLogger for
> >>>> element asyncRoot with params(name="null", name="info", name="false",
> >>>> ={File, STDOUT}, ={},
> >> Configuration(jndi:/localhost/WEB-INF/log4j2.xml),
> >>>> null)
> >>>> 2015-10-12 18:55:25,560 DEBUG Built Plugin[name=asyncRoot] OK from
> >>> factory
> >>>> method.
> >>>> 2015-10-12 18:55:25,561 DEBUG Building Plugin[name=loggers,
> >>>> class=org.apache.logging.log4j.core.config.LoggersPlugin]. Searching
> >> for
> >>>> builder factory method...
> >>>> 2015-10-12 18:55:25,564 DEBUG No builder factory method found in class
> >>>> org.apache.logging.log4j.core.config.LoggersPlugin. Going to try
> >> finding
> >>> a
> >>>> factory method instead.
> >>>> 2015-10-12 18:55:25,565 DEBUG Still building Plugin[name=loggers,
> >>>> class=org.apache.logging.log4j.core.config.LoggersPlugin]. Searching
> >> for
> >>>> factory method...
> >>>> 2015-10-12 18:55:25,565 DEBUG Found factory method [createLoggers]:
> >>> public
> >>>> static org.apache.logging.log4j.core.config.Loggers
> >>
> org.apache.logging.log4j.core.config.LoggersPlugin.createLoggers(org.apache.logging.log4j.core.config.LoggerConfig[]).
> >>>> 2015-10-12 18:55:25,566 DEBUG Calling createLoggers on class
> >>>> org.apache.logging.log4j.core.config.LoggersPlugin for element Loggers
> >>> with
> >>>> params(={root})
> >>>> 2015-10-12 18:55:25,566 DEBUG Built Plugin[name=loggers] OK from
> >> factory
> >>>> method.
> >>>> 2015-10-12 18:55:25,567 TRACE AsyncLoggerConfig[root] starting...
> >>>> 2015-10-12 18:55:25,574 TRACE AsyncLoggerConfigHelper creating new
> >>>> disruptor. Ref count is 1.
> >>>> 2015-10-12 18:55:25,574 DEBUG property
> >>> AsyncLoggerConfig.WaitStrategy=null
> >>>> 2015-10-12 18:55:25,575 DEBUG disruptor event handler uses
> >>>> BlockingWaitStrategy
> >>>> 2015-10-12 18:55:25,625 DEBUG Starting AsyncLoggerConfig disruptor
> with
> >>>> ringbuffer size=262144, waitStrategy=BlockingWaitStrategy,
> >>>> exceptionHandler=null...
> >>>> 2015-10-12 18:55:25,627 DEBUG Started configuration
> >>>> XmlConfiguration[location=jndi:/localhost/WEB-INF/log4j2.xml] OK.
> >>>> 2015-10-12 18:55:25,627 TRACE Stopping
> >>>> org.apache.logging.log4j.core.config.DefaultConfiguration@75c1ada7...
> >>>> 2015-10-12 18:55:25,628 TRACE AbstractConfiguration stopped 0
> >>>> AsyncLoggerConfigs.
> >>>> 2015-10-12 18:55:25,628 TRACE AbstractConfiguration stopped 0
> >>>> AsyncAppenders.
> >>>> 2015-10-12 18:55:25,628 TRACE AbstractConfiguration stopped 1
> >> Appenders.
> >>>> 2015-10-12 18:55:25,628 TRACE AbstractConfiguration stopped 0 Loggers.
> >>>> 2015-10-12 18:55:25,629 DEBUG Stopped
> >>>> org.apache.logging.log4j.core.config.DefaultConfiguration@75c1ada7 OK
> >>>> 2015-10-12 18:55:25,634 DEBUG Registering MBean
> >>>> org.apache.logging.log4j2:type=2090228673
> >>>> 2015-10-12 18:55:25,642 DEBUG Registering MBean
> >>>> org.apache.logging.log4j2:type=2090228673,component=StatusLogger
> >>>> 2015-10-12 18:55:25,647 DEBUG Registering MBean
> >>>> org.apache.logging.log4j2:type=2090228673,component=ContextSelector
> >>>> 2015-10-12 18:55:25,649 DEBUG Registering MBean
> >>>> org.apache.logging.log4j2:type=2090228673,component=Loggers,name=
> >>>> 2015-10-12 18:55:25,653 DEBUG Registering MBean
> >>
> org.apache.logging.log4j2:type=2090228673,component=Loggers,name=,subtype=RingBuffer
> >>>> 2015-10-12 18:55:25,657 DEBUG Registering MBean
> >>
> org.apache.logging.log4j2:type=2090228673,component=Appenders,name=STDOUT
> >>>> 2015-10-12 18:55:25,659 DEBUG Registering MBean
> >>>>
> org.apache.logging.log4j2:type=2090228673,component=Appenders,name=File
> >>>> 2015-10-12 18:55:25,660 DEBUG LoggerContext[name=2090228673,
> >>>> org.apache.logging.log4j.core.LoggerContext@4347ede7] started OK with
> >>>> configuration
> >>>> XmlConfiguration[location=jndi:/localhost/WEB-INF/log4j2.xml].
> >>>> 2015-10-12 18:55:26,198 DEBUG Starting RollingFileManager
> >>>> /data/applogs/pigeon/pigeon.data-proxy.log
> >>>> 2015-10-12 18:55:26,200 DEBUG PluginManager 'FileConverter' found 2
> >>> plugins
> >>>> 2015-10-12 18:55:26,203 TRACE PatternProcessor.getNextTime returning
> >>>> 2015/10/13-00:00:00.000, nextFileTime=2015/10/12-00:00:00.000,
> >>>> prevFileTime=1970/01/01-08:00:00.000, current=2015/10/12-18:55:26.202,
> >>>> freq=DAILY
> >>>> 2015-10-12 18:55:26,204 TRACE PatternProcessor.getNextTime returning
> >>>> 2015/10/13-00:00:00.000, nextFileTime=2015/10/12-00:00:00.000,
> >>>> prevFileTime=2015/10/12-00:00:00.000, current=2015/10/12-18:55:26.203,
> >>>> freq=DAILY
> >>>> 2015-10-12 18:55:26,204 DEBUG Starting OutputStreamManager SYSTEM_ERR
> >>>> 2015-10-12 18:55:26,207 DEBUG Starting RollingFileManager
> >>>> /data/applogs/pigeon/pigeon.data-proxy.access.log
> >>>> 2015-10-12 18:55:26,207 DEBUG PluginManager 'FileConverter' found 2
> >>> plugins
> >>>> 2015-10-12 18:55:26,208 TRACE PatternProcessor.getNextTime returning
> >>>> 2015/09/30-00:00:00.000, nextFileTime=2015/09/29-00:00:00.000,
> >>>> prevFileTime=1970/01/01-08:00:00.000, current=2015/10/12-18:55:26.208,
> >>>> freq=DAILY
> >>>> 2015-10-12 18:55:26,209 TRACE PatternProcessor.getNextTime returning
> >>>> 2015/09/30-00:00:00.000, nextFileTime=2015/09/29-00:00:00.000,
> >>>> prevFileTime=2015/09/29-00:00:00.000, current=2015/10/12-18:55:26.209,
> >>>> freq=DAILY
> >>>> 2015-10-12 18:55:26,239 DEBUG Using default SystemClock for timestamps
> >
> >
> >
> > --
> > E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
> > Java Persistence with Hibernate, Second Edition
> > <http://www.manning.com/bauer3/>
> > JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> > Spring Batch in Action <http://www.manning.com/templier/>
> > Blog: http://garygregory.wordpress.com
> > Home: http://garygregory.com/
> > Tweet! http://twitter.com/GaryGregory
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
> For additional commands, e-mail: log4j-user-h...@logging.apache.org
>
>

Reply via email to