logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Gregory (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LOG4J2-893) NullPointerException on core.Logger$PrivateConfig.filter() when mapping JUL to Log4j2
Date Wed, 12 Nov 2014 17:50:34 GMT

    [ https://issues.apache.org/jira/browse/LOG4J2-893?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14208326#comment-14208326
] 

Gary Gregory commented on LOG4J2-893:
-------------------------------------

In the current version in git of Finagle's LoadService.scala, the statement that corresponds
to:

{noformat}
at com.twitter.finagle.util.LoadService$$anonfun$apply$9.apply(LoadService.scala:186)
{noformat}
is:
{noformat}
      DefaultLogger.log(
        Level.DEBUG,
        "LoadService: loaded instance of class %s for requested service %s".format(className,
ifaceName)
      )
{noformat}

But DefaultLogger is not our ApiLogger... so what version of Finagle do you use?



> NullPointerException on core.Logger$PrivateConfig.filter() when mapping JUL to Log4j2
> -------------------------------------------------------------------------------------
>
>                 Key: LOG4J2-893
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-893
>             Project: Log4j 2
>          Issue Type: Bug
>    Affects Versions: 2.1
>         Environment: Mac OSX, Scala 2.10.4, SBT 0.13, Java(TM) SE Runtime Environment
(build 1.7.0_45-b18)
>            Reporter: Markus Lachinger
>         Attachments: breaklog4jul.zip
>
>
> I have a project in scala loading log4j2-core, api, jul, slf4j and jcl and try to map
the JUL to Log4J by using the following java parameter:
> -Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager
> I also use Twitter Server which uses JUL to log it's messages.
> When I start up the server with the JUL mapping for Log4J I get a NullPointerException.
> The exception and code is here:
> https://gist.github.com/mmlac/2e2b38dc3fbd0e5b0da4
> Might be related to LOG4J2-234
> {noformat}
> ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging
only errors to the console.
> Exception in thread "main" java.lang.ExceptionInInitializerError
> at com.twitter.server.Admin$class.$init$(Admin.scala:13)
> at foo.bar.Foo$.<init>(Foo.scala:8)
> at foo.bar.Foo$.<clinit>(Foo.scala)
> at foo.bar.Foo.main(Foo.scala)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)
> at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
> Caused by: java.lang.NullPointerException
> at org.apache.logging.log4j.core.Logger$PrivateConfig.filter(Logger.java:301)
> at org.apache.logging.log4j.core.Logger.isEnabled(Logger.java:122)
> at org.apache.logging.log4j.spi.ExtendedLoggerWrapper.isEnabled(ExtendedLoggerWrapper.java:87)
> at org.apache.logging.log4j.spi.AbstractLogger.logIfEnabled(AbstractLogger.java:699)
> at org.apache.logging.log4j.jul.WrappedLogger.log(WrappedLogger.java:50)
> at org.apache.logging.log4j.jul.ApiLogger.log(ApiLogger.java:106)
> at com.twitter.finagle.util.LoadService$$anonfun$apply$9.apply(LoadService.scala:186)
> at com.twitter.finagle.util.LoadService$$anonfun$apply$9.apply(LoadService.scala:181)
> at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
> at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
> at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
> at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)
> at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
> at scala.collection.AbstractTraversable.map(Traversable.scala:105)
> at com.twitter.finagle.util.LoadService$.apply(LoadService.scala:181)
> at com.twitter.finagle.http.HttpMuxer$.<init>(HttpMuxer.scala:118)
> at com.twitter.finagle.http.HttpMuxer$.<clinit>(HttpMuxer.scala)
> ... 9 more
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message