2014-04-11 38 views
0

我在Websphere>控制台首选项中启用了“Log command assistance commands”选项。 该文档说明了以下内容: 指定是否将所有命令帮助wsadmin数据记录到文件。此文件保存到$ {LOG_ROOT}/server/commandAssistanceJythonCommands_user name.log: server是控制台运行的服务器进程,如server1或adminagent。 服务器是控制台运行的服务器进程,如dmgr,server1,adminagent或jobmgr。 用户名是管理控制台用户名。 使用管理代理管理配置文件时,命令帮助日志将放入管理代理正在管理的配置文件的位置。 $ {LOG_ROOT}变量定义配置文件位置。启用wsadmin控制台协助

我无法找到LOG_ROOT的默认值。

回答

0

LOG_ROOT的实际值取决于其他变量的值。变量在AdminConsole - > Environment - > WebSphere Variables中定义。由于变量存在于不同的作用域(单元,节点,集群,服务器),因此查找实际值可能有点棘手。最终的解决方案是使用wsadmin和AdminOperations.expandVariable操作。

对于ND环境:

adminOperations = AdminControl.queryNames('WebSphere:*,type=AdminOperations,process=dmgr').splitlines()[0] 
print AdminControl.invoke(adminOperations, 'expandVariable', ['${LOG_ROOT}/commandAssistance_ssdimmanuel.log']) 

对于独立为(假设服务器名称为 'server1的'):

adminOperations = AdminControl.queryNames('WebSphere:*,type=AdminOperations,process=server1').splitlines()[0] 
print AdminControl.invoke(adminOperations, 'expandVariable', ['${LOG_ROOT}/commandAssistance_ssdimmanuel.log']) 

广告模式

使用WDR库(http://wdr.github.io/WDR/)你可以用一条简单的线做:

对于ND:

print getMBean1(type='AdminOperations', process='dmgr').expandVariable('${LOG_ROOT}/commandAssistance_ssdimmanuel.log') 

对于独立WAS:

print getMBean1(type='AdminOperations', process='server1').expandVariable('${LOG_ROOT}/commandAssistance_ssdimmanuel.log')