我正在尝试使每个部署的日志记录工作。我有包含内容的战争logging.properties
档案WEB-INF/
:
ru.home.level=FINEST
在 servlet 中我这样做:
protected Logger log = Logger.getLogger("ru.home.Something");
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
log.log(Level.FINEST, "Hello");
resp.getWriter().write("<b>tralalala</b>");
log.log(Level.FINEST, "Bye");
}
根据部署期间的 WildFly 日志记录配置文档,它应该扫描并在适当的位置找到我的属性文件。但似乎它根本不扫描。我究竟做错了什么?(https://docs.jboss.org/author/display/WFLY9/Logging+Configuration#LoggingConfiguration-PerdeploymentLogging)另外:
/subsystem=logging:read-attribute(name=use-deployment-logging-config)
返回:
{
"outcome" => "success",
"result" => true
}