我正在尝试Audit4J(2.4.1)并按照文档进行操作,但我的audit4j.conf.yml文件似乎错了。
我用:
!Configuration
handlers:
- !org.audit4j.core.handler.ConsoleAuditHandler {}
layout: !org.audit4j.core.layout.SimpleLayout
dateFormat: dd-MM-yyyy HH:mm:ss
metaData: !org.audit4j.core.DummyMetaData {}
这会产生以下错误:
org.audit4j.core.exception.InitializationException: initialization failed.!!
....
Caused by: org.audit4j.core.exception.ConfigurationException: Configuration Exception
....
Caused by: com.esotericsoftware.yamlbeans.YamlException: Error parsing YAML.
....
Caused by: com.esotericsoftware.yamlbeans.parser.Parser$ParserException: Line 7, column 13: Expected a 'block end' but found: block mapping start
任何人都知道这里有什么问题吗?
此致 杰拉德
答案 0 :(得分:0)
正确的格式是:
layout: !org.audit4j.core.layout.SimpleLayout {
dateFormat: "dd/MM/yyyy HH:mm:ss"
}