Special Logging Configurations - Documentation topics on: additional logging configurations,garbage collection,gc garbagecollector java jdk,log files,logging configuration,logging sql statements,velocity logging,.

Special Logging Configurations

The following configurations allow you to enable special logging features for use in troubleshooting dotCMS.

Note: All of these features greatly increase the amount of logging performed by dotCMS, and may significantly impact performance. It is strongly recommended that you do not enable these features on production systems.

Velocity Template Logging

When developing Templates, it may be useful to log the template name to verify which templates are being used, and identify which template may be causing an error. By default this feature is disabled, and template names are not logged.

To turn on template logging, set the LOG_VELOCITY_TEMPLATES property to true in the dotmarketing-config.properties file. This will log the name of each template before parsing it.


Note: It is strongly recommended that you make all changes to the dotmarketing-config.properties file through a properties extension file.

SQL Query Logging

When troubleshooting SQL queries, it may be helpful to log the actual queries sent to the database so they can be manually inspected and verified. By default, this feature is disabled, and SQL queries are not logged.

To enable this feature, set the hibernate.show_sql property in the system.properties file to true:


Important: This feature should not be enabled on production systems.

  • Enabling this feature greatly increases log sizes and causes significant performance degredation.
  • This feature is intended for troubleshooting and debugging purposes only.
    • The hibernate.show_sql property should be reset to false as soon as troubleshooting is completed.

Note: It is strongly recommended that you make all changes to the system.properties file through a properties extension file.

ElasticSearch Slow Query Logging

You may configure ElasticSearch in dotCMS to automatically log slow ElasticSearch queries, to help you identify and improve queries that take longer than expected. By default, this feature is disabled, and no log files are created to log slow queries.

To enable this feature, uncomment all the properties in the dotcms-cluster-config.properties file that begin with es.index.search.slowlog.

Note: It is strongly recommended that you make all changes to the dotcms-cluster-config.properties file through a properties extension file.



es.index.search.slowlog.levelSpecifies the logging level to use for slow ElasticSearch queries. This level will be used to determine which of the threshold.query and threshold.fetch properties are used.
es.index.search.slowlog.threshold.querySets the time limit to send a query and receive a response.
es.index.search.slowlog.threshold.fetchSets the time limit to fetch all the query results.

Rules Feature Slow Rule Logging

Since Rules may be executed as often as every time a user visits any page, Rules that execute slowly may significantly impact the performance of your site. You may troubleshoot Rules performance issues by setting the SLOW_RULE_LOG_MIN property in the dotmarketing-config.properties file:


Note: It is strongly recommended that you make all changes to the dotmarketing-config.properties file through a properties extension file.

The value you set specifies a time limit in milliseconds; any time a rule takes longer to execute than you specify, a message will be logged to the dotCMS log file.

Java Garbage Collection Logging

In some rare cases, you may wish to log information about Java garbage collection in order to troubleshoot Java performance or memory usage. To enable this feature, the following flags must be added to the JAVA_OPTS environment variable in the dotCMS startup script: