In general, the listeners are nothing but parameters that allow the users to configure custom code/actions. To better understand the context/usage of the listeners, please refer to the external article here.
When a requirement to update/add a listener configuration to the underlying Tomcat in Artifactory comes into the picture, you may follow the below steps to get it done easily.
Step 1- Consider taking a backup of the system.yaml file present in the $JFROG_HOME/artifactory/var/etc/ directory.
Step 2 - Use the sample snippet added below for reference to update the custom listener configuration per the requirement. (YAML elements highlighted in the below example should be intended properly)
For example: (We are adding the following listeners to the configuration.
“Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />” and “<Listener className="org.apache.catalina.security.SecurityListener" checkedOsUsers="suhas" minimumUmask="0007"”
shared: tomcat: connector: extra: <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" /> <Listener className="org.apache.catalina.security.SecurityListener" checkedOsUsers="suhas" minimumUmask="0007" />
Step 3- Perform the Artifactory service restart.
Upon a successful restart, we will be able to confirm the addition of listeners by parsing the Apache tomcat server.xml file present under $CATALINA_HOME/conf/ directory.