Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta3
    • Fix Version/s: 2.0-beta4, 2.0-beta8
    • Component/s: None
    • Labels:
      None
    • Environment:

      Description

      I try to use the SocketAppender and get the following ERROR/NPE:

      2013-01-06 00:54:14,024 DEBUG Generated plugins in 0.000032000 seconds
      2013-01-06 00:54:14,044 DEBUG Calling createLayout on class org.apache.logging.log4j.core.layout.PatternLayout for element PatternLayout with params(pattern="%d

      {HH:mm:ss.SSS}

      [%t] %-5level %logger

      {36} — %msg%n", Configuration(/Users/jhuxhorn/Documents/Projects/huxi/lilith/sandbox/log4j2-sandbox/build/resources/main/log4j2.xml), null, charset="null")
      2013-01-06 00:54:14,045 DEBUG Generated plugins in 0.000029000 seconds
      2013-01-06 00:54:14,049 DEBUG Calling createAppender on class org.apache.logging.log4j.core.appender.ConsoleAppender for element Console with params(PatternLayout(%d{HH:mm:ss.SSS} [%t] %-5level %logger{36}

      — %msg%n), null, target="SYSTEM_OUT", name="Console", suppressExceptions="null")
      2013-01-06 00:54:14,049 DEBUG Calling createLayout on class org.apache.logging.log4j.core.layout.SerializedLayout for element SerializedLayout
      2013-01-06 00:54:14,052 DEBUG Calling createAppender on class org.apache.logging.log4j.core.appender.SocketAppender for element Socket with params(host="localhost", port="4560", protocol="null", reconnectionDelay="null", name="Socket", immediateFlush="null", suppressExceptions="null", SerializedLayout(org.apache.logging.log4j.core.layout.SerializedLayout@5cc4211b), null)
      2013-01-06 00:54:14,054 ERROR Unable to invoke method createAppender in class org.apache.logging.log4j.core.appender.SocketAppender for element Socket java.lang.reflect.InvocationTargetException
      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:601)
      at org.apache.logging.log4j.core.config.BaseConfiguration.createPluginObject(BaseConfiguration.java:711)
      at org.apache.logging.log4j.core.config.BaseConfiguration.createConfiguration(BaseConfiguration.java:477)
      at org.apache.logging.log4j.core.config.BaseConfiguration.createConfiguration(BaseConfiguration.java:469)
      at org.apache.logging.log4j.core.config.BaseConfiguration.doConfigure(BaseConfiguration.java:156)
      at org.apache.logging.log4j.core.config.BaseConfiguration.start(BaseConfiguration.java:114)
      at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:251)
      at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:267)
      at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:134)
      at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:75)
      at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:30)
      at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:165)
      at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:174)
      at de.huxhorn.lilith.sandbox.Log4j2Sandbox.main(Log4j2Sandbox.java:43)
      Caused by: java.lang.NullPointerException
      at org.apache.logging.log4j.core.appender.SocketAppender.createSocketManager(SocketAppender.java:95)
      at org.apache.logging.log4j.core.appender.SocketAppender.createAppender(SocketAppender.java:86)
      ... 17 more

      2013-01-06 00:54:14,056 ERROR Null object returned for Socket in appenders

      My configuration looks like this:
      <?xml version="1.0" encoding="UTF-8"?>
      <configuration status="debug">
      <appenders>
      <Console name="Console" target="SYSTEM_OUT">
      <PatternLayout pattern="%d

      {HH:mm:ss.SSS}

      [%t] %-5level %logger

      {36}

      — %msg%n"/>
      </Console>
      <Socket name="Socket" host="localhost" port="4560">
      <SerializedLayout />
      </Socket>
      </appenders>
      <loggers>
      <root level="all">
      <appender-ref ref="Console"/>
      <appender-ref ref="Socket"/>
      </root>
      </loggers>
      </configuration>

      1. log4j2-139.diff
        1 kB
        Gary Gregory

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Ralph Goers
            Reporter:
            Joern Huxhorn
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development