There are two ways to enable logging within the VM Access proxy. 


- Enable Debug Logging through a Command Workflow within vCommander

- Enable Logging through VI or Nano, within the appliance





Enable Debug Logging through a Command Workflow within vCommander


  1. Log into vCommander and create a new "Command Workflow Configuration" by going to the Configuration tab > Command Workflow.



  2. Click Add to create a new Command Workflow.



  3. Name the Workflow "Enable Access Proxy Logs"



  4. Click Add > Guest OS > Run Program.

  5. Insert the following text into the "Command Line" window.

    sudo chmod 777 /var/lib/tomcat/common/classes/log4j2.xml

  6. Click Add > Wait for Event. Change the Wait Time to 5 seconds. Click next 
  7.  Click Add > Guest OS > Create a file
  8. Click Add Credentials to add your Proxy Server's credentials.

    Defaults:
    username: vcommander
    password: gRHrB211

    Select the newly added credentials. 
  9. Copy and paste the following text into the "Contents" page:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
    <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
        <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
            <layout class="org.apache.log4j.PatternLayout">
                <param name="ConversionPattern" value="%d [%t] [%-5p] %c{1} - %m%n"/>
            </layout>
        </appender>
        <appender name="F1" class="org.apache.log4j.RollingFileAppender">
            <param name="File" value="/var/lib/tomcat8/logs/remoteAccess.log"/>
            <param name="MaxBackupIndex" value="10"/>
            <param name="MaxFileSize" value="10MB"/>
            <layout class="org.apache.log4j.PatternLayout ">
                <param name="ConversionPattern" value="%d [%t] %p - %m%n"/>
            </layout>
        </appender>
        <logger name="SSLConfig">
            <level value="DEBUG"/>
        </logger>
        <root>
            <level value="ALL"/>
            <appender-ref ref="CONSOLE"/>
            <appender-ref ref="F1"/>
        </root>
    </log4j:configuration>


  10. Check off "Overwrite"
  11.  Click Add > Guest OS > Run Program.

    Select the vCommander credentials from the drop down, and insert the following text into the command line window:

    sudo service tomcat8 restart


  12. Click next until the workflow is complete. 



Run the Command Workflow


  1. Go to the Operational view within vCommander (Views > Operational
  2. Select the Proxy VM, right click, run workflow.
  3. Select the "Enable VM Access Proxy Log" workflow and click run.








Enable Logging through VI or Nano, within the appliance 


  1. Login to the VM Access Proxy appliance:

        Username - vcommander

        Password - gRHrB211


        2. Issue the command sudo service tomcat8 stop, enter the password when prompted.


        3. Issue the command:

        sudo nano /var/lib/tomcat8/common/classes/log4j2.xml


        4. Locate the line <level value="info"/> 5th line from the bottom



        5. Change the line so it reads: <level value="ALL"/>


        6. Press theCTRL-x, followed by "y" to save, then press enter to confirm the file name.


        7. Issue the command:

        sudo service tomcat8 start



See Also


Retrieving VM Access Proxy Logs