majikthys / log4j2-logstash-jsonevent-layout

Log4J2 Layout as a Logstash "json_event"
Other
40 stars 34 forks source link

Exception due to UnmodifiableMap.putAll() #32

Closed farooq-khan-nxt closed 8 years ago

farooq-khan-nxt commented 8 years ago

I tried to use this Layout, however i get this exception, going to dig further but superficially looks like a attempt to modify a Unmodifiable Map is being made in the toSerializable method.

Partial Exception stack trace:

org.apache.logging.log4j.core.config.AwaitCompletionReliabilityStrategy.log(AwaitCompletionReliabilityStrategy.java:63)\n\torg.apache.logging.log4j.core.Logger.logMessage(Logger.java:147)\n\torg.apache.logging.slf4j.Log4jLogger.log(Log4jLogger.java:375)\n\torg.apache.commons.logging.impl.SLF4JLocationAwareLog.info(SLF4JLocationAwareLog.java:155)\n\torg.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:488)\n\torg.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)\n\tjavax.servlet.GenericServlet.init(GenericServlet.java:158)\n\torg.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)\n\torg.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)\n\torg.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)\n\torg.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522)\n\torg.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095)\n\torg.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)\n\torg.apache.tomcat.util.net.AprEndpoint$SocketWithOptionsProcessor.run(AprEndpoint.java:2437)\n\tjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\n\tjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\n\torg.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)\n\tjava.lang.Thread.run(Thread.java:745)\n

root cause

java.lang.UnsupportedOperationException\n\tjava.util.Collections$UnmodifiableMap.putAll(Collections.java:1463)\n\torg.apache.logging.log4j.core.layout.LogStashJSONLayout.toSerializable(LogStashJSONLayout.java:175)\n\torg.apache.logging.log4j.core.layout.LogStashJSONLayout.toSerializable(LogStashJSONLayout.java:41)\n\torg.apache.logging.log4j.core.layout.AbstractStringLayout.toByteArray(AbstractStringLayout.java:148)\n\torg.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.append(AbstractOutputStreamAppender.java:112)\n\torg.apache.logging.log4j.core.config.AppenderControl.tryCallAppender(AppenderControl.java:152)\n\torg.apache.logging.log4j.core.config.AppenderControl.callAppender0(AppenderControl.java:125)\n\torg.apache.logging.log4j.core.config.AppenderControl.callAppenderPreventRecursion(AppenderControl.java:116)\n\torg.apache.logging.log4j.core.config.AppenderControl.callAppender(AppenderControl.java:84)\n\torg.apache.logging.log4j.core.config.LoggerConfig.callAppenders(LoggerConfig.java:390)\n\torg.apache.logging.log4j.core.config.LoggerConfig.processLogEvent(LoggerConfig.java:378)\n\torg.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:362)\n\torg.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:352)

farooq-khan-nxt commented 8 years ago

Looks like there is already a issue for this problem closing this one