2017-04-05 89 views
0

我試着Audit4J(2.4.1)並按照文檔,但我的audit4j.conf.yml文件似乎是錯誤的。Audit4j 2.4.1配置失敗

我用:

!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

的正確格式爲:

layout: !org.audit4j.core.layout.SimpleLayout { 
    dateFormat: "dd/MM/yyyy HH:mm:ss" 
    }