The configuration of the JCMS logs is located in the file /WEB-INF/data/log4j.xml

It is a configuration file Log4J that follows the XML syntax described on the site (same http://logging.apache.org/log4j/2.x/manual/configuration.html#XML syntax as "log4net")

By default in JCMS we define the generic logs to WARN and the JCMS logs to INFO ; a comment precedes each statement to indicate what it is about:

  • ROOT (global default configuration): WARN
  • jsp : INFO : For all logs issued from a jsp, the name of the logger will be similar to the path of the jsp on which the request is made. For example, a log sent from the editor of an Article will be sent by the logger "jsp.types.Article.editArticle_jsp"
  • custom : INFO : Custom
  • generated package classes: INFO: Generated
  • com.jalios classes: INFO: Jalios
  • jcmsplugin internal classes: INFO : Module-specific logs (go back to the control interface of each module)

 

As a comment in the file are proposed to you :

  • org.hibernate.SQL : DEBUG : to activate to see the SQL queries in the logs
  • various examples of JCMS packages in DEBUG mode :
    • com.jalios.jcms : JCMS
    • com.jalios.util core : Jalios
    • com.jalios.ldap utility classes : LDAP
    • com.jalios.io interface : reading/writing in the file
    • com.jalios.jstore system : Store
    • com.jalios.jspengine low-level layer : compiling jsp
    • com.jalios.jcms.taglib : layer managing jsp
    • com.jalios.jcms.webdav taglib : WebDAV
    • jcmsplugin.VerbosePlugin interface : generic example for specific logs issued from modules ; replace "VerbosePlugin" by the technical name of the module concerned

 

Based on the same principle as the proposed examples, you can add your own rules. Here are other examples of packages :

  • com.jalios.jdring : scheduled
  • com.jalios.jcms.search tasks manager : for searches in lucene
  • com.jalios.jcms.rest : JCMS
  • com.jalios.jcmsplugin.pdfconverter REST interface : PDF
  • com.jalios.jcmsplugin.documentviewer conversion module : document viewer module
  • com.jalios.jcmsplugin.waffle & : waffle.servlet SSO Waffle module and its servlet : Asynchronous file processing
  • com.jalios.jcms.fileprocessor engine (conversion, indexing, ...) On

external libraries, for example the C3P0 pool of connection in DEBUG mode

  • com.mchange.v2.c3p0
  • com.mchange.v2.resourcepool

 

 

Changing the level can often be done hot, i.e. without restarting the application.

In some rare cases, one may want to see in an exhaustive way all the information concerning the exchanges with the database. Here is how to proceed (note that the hot modification does not work in this case, be careful, the log files then quickly become very large)

 

  <!-- trace all SQL requests sent by Hibernate (must be set to trace before loading) -->
  <logger name="org.hibernate.SQL"><level value="TRACE" /></logger>

  <!-- trace data bindings during SQL requests sent by Hibernate (must be set to trace before loading) -->
  <logger name="org.hibernate.type"><level value="TRACE" /></logger>
  <!-- reduce verbosity by assigning DEBUG instead of Trace for specific types -->
  <!--
  <logger name="org.hibernate.type.BooleanType"><level value="DEBUG" /></logger>
  <logger name="org.hibernate.type.CollectionType"><level value="DEBUG" /></logger>
  <logger name="org.hibernate.type.DateType"><level value="DEBUG" /></logger>
  <logger name="org.hibernate.type.IntegerType"><level value="DEBUG" /></logger>
  <logger name="org.hibernate.type.LongType"><level value="DEBUG" /></logger>
  <logger name="org.hibernate.type.StringType"><level value="TRACE" /></logger>
  <logger name="org.hibernate.type.TextType"><level value="DEBUG" /></logger>
  <logger name="org.hibernate.type.TimestampType"><level value="DEBUG" /></logger>
  -->

  <!-- trace SchemaUpdate sent by Hibernate (must be set to trace before loading) -->
  <logger name="org.hibernate.tool.hbm2ddl.SchemaUpdate"><level value="TRACE" /></logger>

See also