Versions Compared

Key

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

Table of Contents

Scope

  • By default JS7 components products are configured to use log level INFO to limit disk space consumption.
  • Higher log levels such as DEBUG and TRACE can be used to troubleshoot unexplained behavior.
  • For the location of Log4j2 configuration files see the JS7 - Log Files and Locations article.

Log Levels

Log levels can be modified in Log4j2 configuration files, see see the JS7 - Log Files and Locations article for more information.

Changes to the Log4j2 configuration are applied within 60s and do not require the JS7 component product to be restarted.

Anchor
log_level_controller
log_level_controller
Anchor
log_level_agent
log_level_agent
Controller and Agent Log4J2 Configuration

Code Block
languagexml
titleController , Agent 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   <properties>
                <property name="LogLevel">INFO</property>
                <Property name="RetainDays">30d</Property>
                <Property name="MaxSizeOfRolledOverFiles">5GB</Property>
                <Property name="MaxSizePerFile">100MB</Property>
        </properties>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>

Explanations:

Explanation:

  • The Controller and Agent Log4j2 configuration files are the same 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 the debug mode, change the To enable debug mode modify <property name="LogLevelRootLogLevel">INFO</property> and <property name="LogLevelOfDebugLog">OFF</property> to DEBUG.

Anchor
log_level_joc
log_level_joc
JOC Cockpit Log4j2 Configuration

Code Block
languagexml
titleJOC Cockpit log4j2.xml
linenumberstrue
collapsetrue
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
        <Properties>
                <Property name="TimeZone">{Etc/UTC}<>Etc/UTC</Property>
                <Property name="RetainDays">30d</Property>
                <Property name="NumOfFilesPerDayMaxSizeOfRolledOverFiles">5<>5 GB</Property>
                <Property name="MaxSizePerFile">100MB<>100 MB</Property>

         
        <!--Configuration forLog loggerslevel of the web services in joc.log
                        Possibly values are ERROR, WARN, INFO, DEBUG, TRACE
                        Default: INFO
                Root Logger. -->
                <Property name="RootLogLevel">info<>INFO</Property>

                <!--Configuration Configurations for an2nd extra databasedebug log filefiles (database-debug.log) if necessaryOFF|DEBUG|TRACE)
             If one of these values is set to    OFF: without extra log
                        ERROR, WARN, INFO, DEBUG, TRACE: creates extra log with corresponding log levelDEBUG or TRACE then the above
             RootLogLevel has to have the       SQL statement are included from DEBUG and their binding with TRACE
  same value.
              -->
                <Property name="DatabaseLogLevelJocLogLevel">off<>OFF</Property>

        <Property name="ServiceClusterLogLevel">OFF</Property>
       <!--Configuration for an extra shiro log file (shiro.log) if necessary<Property name="ServiceHistoryLogLevel">OFF</Property>
                        OFF: without extra log<Property name="ServiceDailyPlanLogLevel">OFF</Property>
                        ERROR, WARN, INFO, DEBUG, TRACE: creates extra log with corresponding log level<Property name="ServiceCleanupLogLevel">OFF</Property>
                        SQL statement are included from DEBUG and their binding with TRACE<Property name="ServiceMonitorLogLevel">OFF</Property>
                -->
     <Property name="AuthLogLevel">OFF</Property>
           <Property name="AuthLogLevelConnectionPoolLogLevel">off<>OFF</Property>
        </Properties>
        ...
<Configuration>

ExplanationsExplanation:

  • To enable the debug mode modify , change the <property name="RootLogLevel">INFO</property> to DEBUG.Optionally, additional log files can be specified for database operations and authentication steps that receive the sam In addition, modify the value of one or more of the following properties to enable debug output with the respective debug log file: 


  • Modify <Property name="DatabaseLogLevel">off</Property> to ON.
  • Modify 
    Debug Log FileProperty
    joc-debug.log<Property name="JocLogLevel">DEBUG</Property>
    service-cluster-debug.log<Property name="ServiceClusterLogLevel">DEBUG</Property>
    service-history-debug.log<Property name="ServiceHistoryLogLevel">DEBUG</Property>
    service-dailyplan-debug.log<Property name="ServiceDailyPlanLogLevel">DEBUG</Property>
    service-cleanup-debug.log<Property name="ServiceCleanupLogLevel">DEBUG</Property>
    service-monitor-debug.log<Property name="ServiceMonitorLogLevel">DEBUG</Property>
    authentication-debug.log
    <Property name="AuthLogLevel"
    >off<
    >DEBUG</Property>
     to ON.
    connection-pool-debug.log<Property name="ConnectionPoolLogLevel">DEBUG</Property>

Log Rotation Settings

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

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

...

Such options are applied for specific areas of interest and are forwarded by use of the JAVA_OPTIONS environment variable.

Applying debug options requires the respective JS7 component product in question to be restarted.

Anchor
debug_controller
debug_controller
Anchor
debug_agent
debug_agent
Applying Debug Options to Controller and Agent

The examples below examples make use of the -Djavax.net.debug=ssl Java option that is used to receive detailed information e.g. about TLS/SSL certificate handling. However, any Java options can be forwarded like this.

...

in this manner.

Log File

Output created from Java debug options is written to the stdout channel and therefore is added to the watchdog.log file in the Controller's or Agent's logs directory, see the JS7 - Log Files and Locations article.

Unix Operating Systems

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

  • From the Unix command line or from the Controller instance, start the controller_<instance>.sh script:

    Code Block
    languagebash
    titleWindows Unix example to run the Controller start script with debug options
    @rem# Set debug options before running the Controller start script
    setexport JAVA_OPTIONS="-Djavax.net.debug=ssl"
    .\/controller.cmdsh start
    
    @rem# Alternatively set debug options when running the Controller start script
    .\/controller.cmdsh 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"
  • From the Unix command line or from the Agent instance agent_4445.sh start script (assuming that port 4445 is used for the Agent):

    Code Block
    languagebash
    titleWindows Unix example to run the Agent start script with debug options
    @rem# Set debug options before running the Agent start script
    setexport JAVA_OPTIONS="-Djavax.net.debug=ssl"
    .\/agent.cmdsh start
    
    @rem# Alternatively set debug options when running the Agent start script
    .\/agent.cmdsh start --java-options="-Djavax.net.debug=ssl"
  • 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 to specify Java options:
      • Image Removed
    • Consider that the Controller or Agent Windows Service has to be restarted to apply changes to Java options.

Unix Operating Systems

Windows Operating Systems

For Windows, For Unix the JAVA_OPTIONS environment variable can be set before running the Controller or Agent start script like thisscripts as follows: 

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

    Code Block
    languagebash
    titleUnix Windows example to run the Controller start script with debug options
    #@rem Set debug options before running the Controller start script
    exportset JAVA_OPTIONS="-Djavax.net.debug=ssl"
    ./\controller.shcmd start
    
    #@rem Alternatively set debug options when running the Controller start script
    ./\controller.shcmd 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 the agent_4445.cmd script (assuming that port 4445 is used for the Agent):

    Code Block
    languagebash
    titleUnix Windows example to run the Agent instance start script with debug options
    #@rem Set debug options before running the Agent start script
    export frm the command line
    set JAVA_OPTIONS="-Djavax.net.debug=ssl"
    ./\agent.shcmd start
    
    #@rem Alternatively set debug options when running the Agent start script
    ./\agent.shcmd start --java-options="-Djavax.net.debug=ssl"

Applying Debug Options to JOC Cockpit

Windows Operating Systems

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

  • Code Block
    languagebash
    titleWindows example to run the Controller start script with debug options
    @rem Set debug options before running the Controller start script
    
    @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"
    .\jetty.cmd start
  • Alternatively, when operating the Controller or Agent When operating the JOC Cockpit as a Windows Service then, from the .\service directory of the installation, run
    • for a Controller: js7_controller_<controller-id>w.exe
      • where <controller-id> corresponds to the Controller ID the Controller has been installed with.
      • Example: C:\Program Files\sos-berlin.com\js7\controller\my-controller\service\js7_controller_mycontrollerw.exe
    • for an Agent: js7_agent JOC Cockpit: sos_joc_<port>w.exe
      • where <port> corresponds to the port that the JOC Cockpit has been installed forAgent is operated on.
      • Example: C:\Program Files\sos-berlin.com\js7\jocagent_4445\service\sosjs7_jocagent_4446w4445w.exe
    • This brings up a utility that allows to specify Java options to be specified:
    • Image Removed

      • Image Added

    • Note: The Controller or Agent Consider that the JOC Cockpit Windows Service has to be restarted to apply changes to Java options.

Anchor
debug_joc_cockpit
debug_joc_cockpit
Applying Debug Options to JOC Cockpit

Log File

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

Unix Operating Systems

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

  • The Jetty start script is available from the installation directory  /opt/sos-berlin.com/js7/joc/jetty/bin/jetty.sh or a location specified during installation:

    Code Block
    languagebash
    titleUnix example to run the Jetty start script with debug options
    # Set debug options before running the Jetty start script
    export JAVA_OPTIONS="-Djavax.net.debug=ssl"
    ./jetty.sh start
  • When running JOC Cockpit as a daemon then the following line can be added to the  $HOME/.jocrc file of the JOC Cockpit run-time account. This file is created by the installer and is used if it exists and is executable. The $HOME directory is identified from the /etc/passwd file during installation.

    Code Block
    languagebash
    titleUnix example to use $HOME/.jocrc with debug options
    export JAVA_OPTIONS="-Djavax.net.debug=ssl"
  • When running JOC Cockpit as a daemon then the  /etc/default/joc file  file can be created  by the user (requires root permissions):permission). This file is not created by the installer and will be used if it exists and is executable. This file will not be used if the $HOME/.jocrc file is present, see above.

    Code Block
    languagebash
    titleUnix example to use /etc/default/joc with debug options
    export JAVA_OPTIONS="-Djavax.net.debug=ssl"
  • Alternatively the JAVA_OPTIONS environment variable can be set with:

Windows Operating Systems

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

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

    Code Block
    languagebash
    titleWindows example to run the JOC Cockpit start script with debug options
    @rem Set debug options before running the JOC 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: js7_jocw.exe
      • Example: C:\Program Files\sos-berlin.com\js7\joc\service\js7_jocw.exe
    • This brings up a utility that allows Java options to be specified:

      • Image Added

    • Note: The JOC Cockpit Windows Service has to be restarted to apply changes to Java options.

Frequently Used Debug Options

...

  • When configuring certificates for secure HTTPS connections with the JOC Cockpit, Controller and Agents then TLS/SSL debug options will provide detailed information e.g. about about, for example, handshaking and the use of certificates.
  • Use the Java option: -Djavax.net.debug=ssl or -Djavax.net.debug=all
  • You will find debug output:
    • of TLS/SSL certificate negotiation related to a Controller or Agent in the log file: watchdog.log
    • of general authentication steps in the JOC Cockpit log file: authentication-debug.log
    • of TLS/SSL connections in the JOC Cockpit log file: jetty.log.