4-eap,我想自动化独立实例配置是一个脚本文件 oassed 到 jboss-cli 并推荐:
jboss-cli.sh -c --file="我的文件"
在这个文件中,我有一个处理程序和一个我想添加到它的记录器,就像这样:
if (outcome!=success) of /subsystem=logging/periodic-rotating-file-handler=IDTS_FILE_HANDLER:read-resource
echo "adding Log Handler"
/subsystem=logging/periodic-rotating-file-handler=IDTS_FILE_HANDLER:add(file={"path"=>"idts/j/log/idts.log","relative-to"=>"var.opt"},formatter="%d{HH:mm:ss,SSS} %-5p %c{2} [%X{USER}][%X{OPERATION}] %s%E%n",suffix=".yyyy-MM-dd")
else
echo "Log Handler already present"
end-if
if (outcome!=success) of /subsystem=logging/logger=it.idts:read-resource
echo "adding logger"
/subsystem=logging/logger=it.idts:add
/subsystem=logging/logger=it.idts:write-attribute(name="level", value="DEBUG")
/subsystem=logging/logger=it.idts:assign-handler(name="IDTS_FILE_HANDLER")
reload
else
echo "logger already present"
end-if
我得到这个输出:
"adding Log Handler"
"adding logger"
if request failed: {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-3" => "JBAS011536: Handler IDTS_FILE_HANDLER is already assigned."}}
它告诉我已经分配了处理程序,但这不是真的,但是我的文件中不存在记录器(我从一个基本的standalone.xml开始)我不知道该怎么做。
谢谢