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 |
---|
language | xml |
---|
title | Controller , Agent log4j2.xml |
---|
linenumbers | true |
---|
collapse | true |
---|
|
<?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 |
---|
language | xml |
---|
title | JOC Cockpit log4j2.xml |
---|
linenumbers | true |
---|
collapse | true |
---|
|
<?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 extradebug database log filefiles (database-debug.log) if necessaryOFF|DEBUG|TRACE)
If one of these values is set to DEBUG OFF: without extra log
ERROR, WARN, INFO, DEBUG, TRACE: creates extra log with corresponding log levelor 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>
<Property name="ServiceDailyPlanLogLevel">OFF</Property>
OFF: without extra log<Property name="ServiceCleanupLogLevel">OFF</Property>
ERROR, WARN, INFO, DEBUG, TRACE: creates extra log with corresponding log level<Property name="ServiceMonitorLogLevel">OFF</Property>
SQL statement are included from DEBUG and their binding with TRACE
-->
<Property name="ServiceReportsLogLevel">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
. 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. |
Optionally, additional log files can be specified for database operations and authentication steps that receive the sam - Modify
<Property name="DatabaseLogLevel">off</Property>
to ON
. Modify 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> |
service-reports-debug.log | <Property name="ServiceReportsLogLevel">DEBUG</Property> |
authentication-debug.log |
<Property name="AuthLogLevel" |
>off< 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 |
---|
|
Applying Debug Options ...
to Controller and Agent
The examples below use 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 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 Unix, the JAVA_OPTIONS
environment variable can be set before running the Controller or Agent start scripts as follows:
From the Unix command line or from the Controller instance, start the controller_<instance>.sh
script:
script. For Windows 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.cmd./controller.sh start
# Alternatively set debug options when running the Controller start script
./controller.sh start --java-options="-Djavax.net.debug=ssl"
|
@rem Alternatively set debug options when running# For use with a Controller daemon add this line to the Controller instance start script |
.\cmd start --java-optionssh
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):
Windows 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.cmd
./agent.sh start
# Alternatively set debug options when running the Agent start script
./agent.sh start --java-options="-Djavax.net.debug=ssl"
# |
Alternatively set debug options when running For use with an Agent daemon add this line to the Agent instance start script |
.\cmd start --java-optionssh
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 Controller or Agent start scripts as follows:
From the Windows command line or from the Controller instance start the controller_<instance>.cmd
script:
Unix 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.sh
.\controller.cmd start
@rem Alternatively set debug options when running the Controller start script
.\controller.cmd start --java-options="-Djavax.net.debug=ssl"
|
# Alternatively set debug options when running@rem For use with a Controller Windows Service add this line to the Controller instance start script |
./sh start --java-optionscmd
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):
Unix 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.sh
.\agent.cmd start
@rem Alternatively set debug options when running the Agent start script
.\agent.cmd start --java-options="-Djavax.net.debug=ssl"
|
# Alternatively
@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:
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_<port>w.exe
- where
<port>
corresponds to the port that the Agent is operated on. - Example:
C:\Program Files\sos-berlin.com\js7\agent_4445\service\js7_agent_4445w.exe
- This brings up a utility that allows Java options to be specified:
- Image Added
- Note: The Controller or Agent Windows Service has to be restarted to apply changes to Java options.
Anchor |
---|
| debug_joc_cockpit |
---|
| debug_joc_cockpit |
---|
|
Applying Debug Options to JOC CockpitLog 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 as 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 |
---|
language | bash |
---|
title | Unix example to run the Jetty start script with debug options |
---|
|
# Set |
setwhenAgentJetty start script
export JAVA_OPTIONS="-Djavax.net. |
/agent.sh start --java-optionsdebug=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 |
---|
language | bash |
---|
title | Unix 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 can be created by the user (requires root 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 |
---|
language | bash |
---|
title | Unix 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 |
---|
language | bash |
---|
title | Windows 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" |
- xxx
Debug Options for JOC Cockpit
...
- 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
Certificate Management
- When configuring certificates for secure HTTPS connections with the JOC Cockpit, Controller and Agents then TLS/SSL debug options will provide detailed information 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
.