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"
        }

 

    }
}

log4js日志管理模块配置

上一篇:NodeJs——nvm安装和使用


下一篇:.NET 6 Preview 1 发布