Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-3002

java.lang.IllegalArgumentException: maxDepth has been exceeded

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Not A Problem
    • 2.14.0
    • None
    • JsonTemplateLayout
    • None

    Description

      while printing a nested json using JSON template layout, I'm getting "java.lang.IllegalArgumentException: maxDepth has been exceeded" exception.
      I tried setting the property value in .XML file below but this is of no use. Please tell me what am I doing wrong here ?
      I wish to increase the maxdepth limit


      ERROR An exception occurred processing Appender ConsoleAppender java.lang.IllegalArgumentException: maxDepth has been exceeded
      at org.apache.logging.log4j.message.MapMessageJsonFormatter.format(MapMessageJsonFormatter.java:87)
      at org.apache.logging.log4j.message.MapMessageJsonFormatter.lambda$formatMap$0(MapMessageJsonFormatter.java:212)
      at java.util.Map.forEach(Map.java:630)
      at org.apache.logging.log4j.message.MapMessageJsonFormatter.formatMap(MapMessageJsonFormatter.java:197)
      at org.apache.logging.log4j.message.MapMessageJsonFormatter.format(MapMessageJsonFormatter.java:102)
      at org.apache.logging.log4j.message.MapMessageJsonFormatter.formatList(MapMessageJsonFormatter.java:228)
      at org.apache.logging.log4j.message.MapMessageJsonFormatter.format(MapMessageJsonFormatter.java:109)
      at org.apache.logging.log4j.message.MapMessageJsonFormatter.lambda$formatMap$0(MapMessageJsonFormatter.java:212)
      at java.util.Map.forEach(Map.java:630)
      at org.apache.logging.log4j.message.MapMessageJsonFormatter.formatMap(MapMessageJsonFormatter.java:197)
      

      XML file

      <Configuration status="TRACE">
      	<Properties>
              <Property name="log4j2.mapMessage.jsonFormatter.maxDepth">8</Property>
          
        </Properties>
      	<Appenders>
      		<Console name="ConsoleAppender" target="SYSTEM_OUT">
      			<JsonTemplateLayout
      				eventTemplateUri="classpath:log.json" stackTraceEnabled="true"
      				stackTraceElementTemplateUri="classpath:StackTraceElementLayout.json" />
      		</Console>
      	</Appenders>
      
      	<Loggers>
      		<Root level="INFO">
      			<AppenderRef ref="ConsoleAppender" />
      		</Root>
      		<Logger name="software.amazon.awssdk" level="WARN" />
      		<Logger name="software.amazon.awssdk.request" level="DEBUG" />
      	</Loggers>
      </Configuration>
      

      Attachments

        Activity

          People

            vy Volkan Yazici
            anudeepsai Anudeep
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: