Application logs via extension point


It is now possible, via an extension point, to add business logs.

Example of an extension point :

<feature name="runtime.core.externalLogger.myTest">                    
 <extensions>                        
 <extension id="my.appender.name"                                   
 class="org.ametys.runtime.log.StaticExternalLog"                                 
  point="org.ametys.runtime.log.ExternalLogExtensionPoint">                           
 <appender-name>my-logger-xml</appender-name>                           
 <category-name>sitemap.handled-errors</category-name>                           
 <file-prefix>prefix-from-xml</file-prefix>                           
 <additive>false</additive>                           
 <rolling-file>false</rolling-file>                           
 <log-level>DEBUG</log-level>                       
 </extension>                    
 </extensions>                
</feature>                       
  • id: appender name (useful if you need to retrieve it via code)
  • category-name: name of the category of logs to be intercepted by this logger
  • additive: true/false, true to send the logs to the parent. false to keep them at this level.
  • file-prefix: start of file name (date will be added if rolling-file is true)
  • rolling-file: true/false true to create a new file every day
  • log-level: level of logs to be processed. Must be among ALL, TRACE, DEBUG, INFO, WARNING, ERROR, FATAL, OFF
Back to top