设置在哪里可以找到 audit4j 的配置文件
Set where to find the config file for audit4j
我查看了所有文档,但找不到。我怎样才能做到这一点?
根据 Audit4j documentation and javadoc 有多种方式指定配置:
- 它可以被注入 Context directly by calling static methods of the Context class(例如在应用程序启动时 在 进行任何审计之前!):
- Context#initWithConfiguration(Configuration configuration) with the appropriate Configuration
- 或Context#initWithConfiguration(String configFilePath)将配置指定为文件。
- 无需 手动初始化 Context 即可指定配置文件路径的其他方法 是:
- 在环境变量中设置路径“AUDIT4J_CONF_FILE_PATH”
- 在Java系统属性变量中设置路径“audit4j.conf.file.path”
- 配置文件也可以放在应用程序class路径或用户目录。在这种情况下,配置文件的名称必须是 "audit4j.conf.yml" 或 "audit4j.conf.yaml" YAML 风格或 "audit4j.conf.xml" 用于 XML 样式。
我查看了所有文档,但找不到。我怎样才能做到这一点?
根据 Audit4j documentation and javadoc 有多种方式指定配置:
- 它可以被注入 Context directly by calling static methods of the Context class(例如在应用程序启动时 在 进行任何审计之前!):
- Context#initWithConfiguration(Configuration configuration) with the appropriate Configuration
- 或Context#initWithConfiguration(String configFilePath)将配置指定为文件。
- 无需 手动初始化 Context 即可指定配置文件路径的其他方法 是:
- 在环境变量中设置路径“AUDIT4J_CONF_FILE_PATH”
- 在Java系统属性变量中设置路径“audit4j.conf.file.path”
- 配置文件也可以放在应用程序class路径或用户目录。在这种情况下,配置文件的名称必须是 "audit4j.conf.yml" 或 "audit4j.conf.yaml" YAML 风格或 "audit4j.conf.xml" 用于 XML 样式。