正确设置log4j以将日志(警告,信息,错误)重定向到文件

时间:2016-10-19 07:15:50

标签: java log4j

我正在使用log4j来记录我的log4j.properties文件:

# Root logger option
log4j.rootLogger=INFO, stdout, file

# Redirect log messages to a log file
log4j.appender.file=org.apache.log4j.RollingFileAppender
#outputs to Tomcat home
log4j.appender.file.File= D:/log_file.log
log4j.appender.file.MaxFileSize=5MB
log4j.appender.file.MaxBackupIndex=10
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n

它不用于警告请帮助谢谢

1 个答案:

答案 0 :(得分:0)

请看这个:

{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "moduleResolution": "node",
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "removeComments": false,
    "noImplicitAny": false
  },
  "typeRoots": [
    "./node_modules/@types",
    "./src/custom-typings.d.ts"
  ],
  "types": [
    "core-js",
    "jasmine",
    "node",
    "lodash",
    "jquery",
    "requirejs",
    "angular",
    "googlemaps"
  ]
}