Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagexml
titleController log4j2.xml
linenumberstrue
collapsetrue
<?xml version="1.0" encoding="UTF-8"?>
<configuration status="WARN" shutdownHook="disable">
    <Properties>
		<Property name="TimeZone">${env:JS7_CONTROLLER_TZ:-Etc/UTC}</Property>
		<Property name="LogDir">${env:JS7_CONTROLLER_LOGS:-logs}</Property>
		<Property name="LogBasename">${env:JS7_CONTROLLER_APPNAME:-controller}</Property>
		
		<Property name="RetainDays">30d</Property>
		<Property name="MaxSizeOfRolledOverFiles">5 GB</Property>
		<Property name="MaxSizePerFile">100 MB</Property>
		
		<!-- Log level of the Root Logger. -->
		<Property name="RootLogLevel">INFO</Property>
		
		<!-- Configuration for a 2nd debug log file (OFF|DEBUG|TRACE) 
			 If this value is set to DEBUG or TRACE then the above 
			 RootLogLevel has to have the same value.
		-->
		<Property name="LogLevelOfDebugLog">OFF</Property>
		
	</Properties>
        ...
<Configuration>

Explanation:

  • The Log4j2 configuration file is the same for Controllers and Agents except for the fact that environment variables in lines 4-6 for Agents use:
    • <Property name="TimeZone">${env:JS7_AGENT_TZ:-Etc/UTC}</Property>
      <Property name="LogDir">${env:JS7_AGENT_LOGS:-logs}</Property>
      <Property name="LogBasename">${env:JS7_AGENT_APPNAME:-agent}</Property>
  • To enable debug mode modify <property name="RootLogLevel">INFO</property> and <property name="LogLevelOfDebugLog">OFF</property> to DEBUG.

...

When switching to higher log levels such as DEBUG, TRACE then consider increased disc space storage consumption.

By default JS7 components are configured to limit disk space storage consumption and to limit the retention period for log files. Refer to the instructions in the JS7 - Log Rotation article to adjust settings for the max. log file size and retention period.

...

  • from the Windows command line or from the Controller instance start script controller_<instance>.cmd:

    Code Block
    languagebash
    titleWindows example to run the Controller start script with debug options
    @rem Set debug options before running the Controller start script
    set JAVA_OPTIONS="-Djavax.net.debug=ssl"
    .\controller.cmd start
    
    @rem Alternatively set debug options when running the Controller start script
    .\controller.cmd start --java-options="-Djavax.net.debug=ssl"
    
    @rem For use with a Controller Windows service add this line to the Controller instance start script controller_<instance>.cmd
    set JAVA_OPTIONS="-Djavax.net.debug=ssl"
  • from the Windows command line or from the Agent instance start script agent_4445.cmd (assuming that port 4445 is used for the Agent):

    Code Block
    languagebash
    titleWindows example to run the Agent instance start script with debug options
    @rem Set debug options before running the Agent start script from the command line
    set JAVA_OPTIONS="-Djavax.net.debug=ssl"
    .\agent.cmd start
    
    @rem Alternatively set debug options when running the Agent start script
    .\agent.cmd start --java-options="-Djavax.net.debug=ssl"
    
    @rem For use with an Agent Windows service add this line to the Agent instance start script agent_<port>.cmd
    set JAVA_OPTIONS="-Djavax.net.debug=ssl"
  • Alternatively, when operating the Controller or Agent as a Windows Service then from the .\service directory of the installation run
    • for a Controller: sos_jobscheduler_controller_<port>w.exe
    • for an Agent: sos_jobscheduler_agent_<port>w.exe
      • where <port> corresponds to the port that the Controller or Agent has been installed for.
      • Example: C:\Program Files\sos-berlin.com\js7\agent_4445\service\sos_jobscheduler_agent_4445w.exe
    • This brings up a utility that allows Java options to be specified:



    • Note that the Controller or Agent Windows Service has to be restarted to apply changes to Java options.

Unix Operating Systems

For Unix, the JAVA_OPTIONS environment variable can be set before running the Controller or Agent start script like this:

  • Code Block
    languagebash
    titleUnix example to run the Controller start script with debug options
    # Set debug options before running the Controller start script
    export JAVA_OPTIONS="-Djavax.net.debug=ssl"
    ./controller.sh start
    
    # Alternatively set debug options when running the Controller start script
    ./controller.sh start --java-options="-Djavax.net.debug=ssl"
    
    # For use with a Controller daemon add this line to the Controller instance start script controller_<instance>.sh
    export JAVA_OPTIONS="-Djavax.net.debug=ssl"
  • Code Block
    languagebash
    titleUnix example to run the Agent start script with debug options
    # Set debug options before running the Agent start script
    export JAVA_OPTIONS="-Djavax.net.debug=ssl"
    ./agent.sh start
    
    # Alternatively set debug options when running the Agent start script
    ./agent.sh start --java-options="-Djavax.net.debug=ssl"
    
    # For use with an Agent daemon add this line to the Agent instance start script agent_<port>.sh
    export JAVA_OPTIONS="-Djavax.net.debug=ssl"

Applying Debug Options to JOC Cockpit

Log File

Output created from Java debug options is written to the stdout channel and therefore is added to the jetty.log file in the JOC Cockpit's logs directory, see JS7 - Log Files and Locations.

Windows Operating Systems

For Windows, the JAVA_OPTIONS environment variable can be set before running the JOC Cockpit start script like this: 

  • When JOC Cockpit is not installed as Windows Service then the start script C:\Program Files\sos-berlin.com\js7\joc\jetty\bin\jetty.cmd is available.

    Code Block
    languagebash
    titleWindows example to run the Controller JOC Cockpit start script with debug options
    @rem Set debug options before running the ControllerJOC Cockpit start script
    set JAVA_OPTIONS="-Djavax.net.debug=ssl"
    .\jetty.cmd start
  • When operating the JOC Cockpit as a Windows Service then from the .\service directory of the installation run
    • for JOC Cockpit: sos_joc_<port>w.exe
      • where <port> corresponds to the port that the JOC Cockpit has been installed for.
      • Example: C:\Program Files\sos-berlin.com\js7\joc\service\sos_joc_4446w.exe
    • This brings up a utility that allows Java options to be specified:



    • Note that the JOC Cockpit Windows Service has to be restarted to apply changes to Java options.

Unix Operating Systems

For Unix the JAVA_OPTIONS environment variable can be set before running the Jetty start script like this:

...