log4js日志管理模块配置

使用log4js打印日志:
第一步: 导入模块
第二步:配置
 
{
    "appenders": {
        "rule-console": {
            "type": "console"
        },
        "mainlog": {
            "type": "dateFile",
            "filename": "log/Main",
            "encoding": "utf-8",
            "maxLogSize": 10000000,
            "numBackups": 3,
            "pattern": "_MMdd.log",
            "alwaysIncludePattern": true
        }

 

    },

 

    "categories": {
        "default": {
            "appenders": [
                "rule-console",
                "mainlog"
            ],
            "level": "debug"
        },

 

        "error": {
            "appenders": [
                "rule-console"
            ],
            "level": "debug"
        }

 

    }
}
posted @ 2021-02-18 23:50  countryboy666  阅读(392)  评论(0编辑  收藏  举报