log4js error : type "DateFile" could not be found

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/nihaoa50/article/details/80569527

首先我在windows系统上配置log4js(2+)时的配置文件如下

{  
    "appenders":{  
        "console":{  
            "type":"console"  
        },  
        "common-all":{  
            "type":"DateFile",  
            "filename":"../log/common-all",
            "pattern": "-yyyy-MM-dd.log",  
            "alwaysIncludePattern": true,  
            "layout":{"type":"pattern", "pattern":"[%d{yyyy-MM-dd hh:mm:ss} %5.5p] %m"}  
        } 


    },  
    "categories":{  
        "default":{  
            "appenders":["common-all"],  
            "level":"all"  
        }

    }  
}

这个在windows系统运行正常,但是到了服务器(centos系统)时就报错:
这里写图片描述

解决方案:
把”type”:”DateFile”改成”type”:”dateFile”。

猜你喜欢

转载自blog.csdn.net/nihaoa50/article/details/80569527
今日推荐