Question

I enabled the "Log command assistance commands" option in Websphere > console preferences. The documentation says the following : Specifies whether to log all the command assistance wsadmin data to a file. This file is saved to ${LOG_ROOT}/server/commandAssistanceJythonCommands_user name.log: server is the server process where the console runs, such as server1 or adminagent. server is the server process where the console runs, such as dmgr, server1, adminagent, or jobmgr. user name is the administrative console user name. When you manage a profile using an administrative agent, the command assistance log is put in the location of the profile that the administrative agent is managing. The ${LOG_ROOT} variable defines the profile location.

I am not able to find the default value of LOG_ROOT.

Was it helpful?

Solution

The actual value of LOG_ROOT depends on values of other variables. The variables are defined in AdminConsole -> Environment -> WebSphere Variables. Because variables exists at different scopes (cell, node, cluster, server), finding the actual value can be a bit tricky. The ultimate solution is to use wsadmin and AdminOperations.expandVariable operation.

For ND environment:

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

For standalone WAS (assuming that the server name is 'server1'):

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

Advertisement mode

Using WDR library (http://wdr.github.io/WDR/) you could do it in just one simple line:

For ND:

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

For standalone WAS:

print getMBean1(type='AdminOperations', process='server1').expandVariable('${LOG_ROOT}/commandAssistance_ssdimmanuel.log')
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top