Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring boot 如何使用log4j2jsontemplate布局增加字符串长度_Spring Boot_Logging_Log4j_Log4j2_Slf4j - Fatal编程技术网

Spring boot 如何使用log4j2jsontemplate布局增加字符串长度

Spring boot 如何使用log4j2jsontemplate布局增加字符串长度,spring-boot,logging,log4j,log4j2,slf4j,Spring Boot,Logging,Log4j,Log4j2,Slf4j,通过引用()我试图增加消息的长度,因为我得到。。。在日志中。 在链接中,提到了使用属性maxStringLength 我尝试用两种方式添加它: 在log4j2弹簧中添加 <JsonTemplateLayout eventTemplateUri="classpath:log4j2_JsonEventLayout.json" locationInfoEnabled="true" maxStringLength=&q

通过引用()我试图增加消息的长度,因为我得到。。。在日志中。 在链接中,提到了使用属性maxStringLength

我尝试用两种方式添加它:

  • 在log4j2弹簧中添加

    <JsonTemplateLayout eventTemplateUri="classpath:log4j2_JsonEventLayout.json"            
            locationInfoEnabled="true" maxStringLength="30000">
    </JsonTemplateLayout>
    

  • 但是这两种方法都不起作用。

    我完成了您提供的第一步,它可以在不更改
    JsonEventLayout
    文件的情况下工作。
    "message": {
        "$resolver": "message",
        "stringified": true,
        "maxStringLength":30000
    }