I have a project using Logback where the binary appenders work, but the text appenders throw an NPE when they try to doAppend. The stacktrace follows:
Caused by: java.lang.NullPointerException
at net.openhft.chronicle.logger.logback.TextChronicleAppender.doAppend(TextChronicleAppender.java:74)
at net.openhft.chronicle.logger.logback.TextIndexedChronicleAppender.doAppend(TextIndexedChronicleAppender.java:70)
at net.openhft.chronicle.logger.logback.TextIndexedChronicleAppender.doAppend(TextIndexedChronicleAppender.java:30)
at ch.qos.logback.core.spi.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:48)
at ch.qos.logback.classic.Logger.appendLoopOnAppenders(Logger.java:273)
at ch.qos.logback.classic.Logger.callAppenders(Logger.java:260)
at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:442)
at ch.qos.logback.classic.Logger.filterAndLog_0_Or3Plus(Logger.java:396)
at ch.qos.logback.classic.Logger.log(Logger.java:788)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.jboss.logging.Slf4jLocationAwareLogger.doLog(Slf4jLocationAwareLogger.java:89)
at org.jboss.logging.Slf4jLocationAwareLogger.doLogf(Slf4jLocationAwareLogger.java:82)
at org.jboss.logging.Logger.logf(Logger.java:2096)
at org.xnio._private.Messages_$logger.greeting(Messages_$logger.java:652)
at org.xnio.Xnio.<clinit>(Xnio.java:92)
<!-- Logback configuration. See http://logback.qos.ch/manual/index.html -->
<!-- <configuration scan="true" scanPeriod="10 seconds"> -->
<configuration scan="false">
<!-- Trying Chronicle file output -->
<appender name="CHRONICLE" class="net.openhft.chronicle.logger.logback.BinaryVanillaChronicleAppender">
<path>logs/chronicle</path>
<!-- <includeCallerData>true</includeCallerData> -->
<!-- <includeMappedDiagnosticContext>true</includeMappedDiagnosticContext> -->
<!--
Configure the underlying VanillaChronicle, for a list of the options have
a look at net.openhft.chronicle.VanillaChronicleConfig
-->
<!-- <chronicleConfig>
<dataCacheCapacity>128</dataCacheCapacity>
</chronicleConfig> -->
</appender>
<!-- Simple file output -->
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- encoder defaults to ch.qos.logback.classic.encoder.PatternLayoutEncoder -->
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- rollover daily -->
<fileNamePattern>logs/niotooling-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 64 MB -->
<maxFileSize>64 MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<!-- Safely log to the same file from multiple JVMs. Degrades performance! -->
<prudent>true</prudent>
</appender>
<!-- Console output -->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<!-- encoder defaults to ch.qos.logback.classic.encoder.PatternLayoutEncoder -->
<encoder>
<pattern>%-5level %logger{36} - %msg%n</pattern>
</encoder>
<!-- Only log level INFO and above -->
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>INFO</level>
</filter>
</appender>
<!-- Enable FILE and STDOUT appenders for all log messages.
By default, only log at level INFO and above. -->
<root level="INFO">
<appender-ref ref="CHRONICLE" />
<appender-ref ref="FILE" />
<appender-ref ref="STDOUT" />
</root>
<!-- For loggers in the these namespaces, log at all levels. -->
<logger name="user" level="ALL" />
<!-- To log pedestal internals, enable this and change ThresholdFilter to DEBUG
<logger name="io.pedestal" level="ALL" />
-->
</configuration>