Scope
- By default JS7 components 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 JS7 - Log Files and Locations
Log Levels
Log levels can be modified in Log4j2 configuration files, see JS7 - Log Files and Locations.
Changes to the Log4j2 configuration are applied within 60s and do not require the JS7 component to be restarted.
Controller and Agent Log4J2 Configuration
Explanation:
- To enable debug mode modify
<property name="RootLogLevel">INFO</property>
and<property name="LogLevelOfDebugLog">OFF</property>
toDEBUG.
JOC Cockpit Log4j2 Configuration
Explanation:
- To enable debug mode modify
<property name="RootLogLevel">INFO</property>
toDEBUG
. In addition, modify the value of one or more of the following properties to enable debug output with the respective debug log file:Debug Log File Property 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">DEBUG</Property>
connection-pool-debug.log
<Property name="ConnectionPoolLogLevel">DEBUG</Property>
Log Rotation Settings
When switching to higher log levels such as DEBUG, TRACE then consider increased disc space consumption.
By default JS7 components are configured to limit disk space 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.
Debug Options
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 JS7 component in question to be restarted.
Applying Debug Options to Controller and Agent
The below examples make use of the -Djavax.net.debug=ssl
Java option that is used to receive detailed information e.g. about SSL certificate handling. However, any Java options can be forwarded like this.
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 JS7 - Log Files and Locations.
Windows Operating Systems
For Windows, the JAVA_OPTIONS
environment variable can be set before running the Controller or Agent start script like this:
from the Windows command line or from the Controller instance start script
controller_<instance>.cmd
:Windows 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 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 port4445
is used for the Agent):Windows 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 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
- where
- 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.
- for a Controller:
Unix Operating Systems
For Unix, the JAVA_OPTIONS environment variable can be set before running the Controller or Agent start script like this:
- Unix 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"
- Unix 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"
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:
- Windows 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" .\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
- where
- 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.
- for JOC Cockpit:
Unix Operating Systems
For Unix the JAVA_OPTIONS environment variable can be set before running the Jetty start script like this:
- Unix 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 the following line can be added to the
/etc/default/joc
file (requires root permission):Unix example to use /etc/default/joc with debug optionsexport JAVA_OPTIONS="-Djavax.net.debug=ssl"
Frequently Used Debug Options
Certificate Management
- When configuring certificates for secure HTTPS connections with JOC Cockpit, Controller and Agents then SSL debug options will provide detailed information e.g. about handshaking and use of certificates.
- Use the Java option:
-Djavax.net.debug=ssl
or-Djavax.net.debug=all
- Find debug output
- of SSL certificate negotiation related to a Controller or Agent with the log file
watchdog.log
- of general authentication steps with the JOC Cockpit log file
authentication-debug.log
- of SSL connections with the JOC Cockpit log file
jetty.log
.
- of SSL certificate negotiation related to a Controller or Agent with the log file