2020 Apr 16 2:12 PM - edited 2024 Feb 03 6:38 PM
error2.png error1.png
Hello,
We are trying to run the below groovy script using ant command.
groovy script :
import org.apache.log4j.LogManager
import org.apache.log4j.Logger
import org.apache.log4j.Level
def classnamearray = ["de.hybris.platform.jalo.flexiblesearch.FlexibleSearch","de.hybris.platform.cronjob.jalo.FlexibleSearchCronJob"]
String setlevel = "INFO"
for (logclassname in classnamearray){
mapLoggers = ["${logclassname}" : "${setlevel}"]
mapLoggers.collect {
Logger logger = LogManager.getLogger(it.getKey())
println "Before: " + logger.getName() + "=" + logger.getLevel()
logger.setLevel(Level.toLevel(it.getValue())) println "After : " + logger.getName() + "=" + logger.getLevel()
} }
This is working correctly when we run in HAC. The Hybris version we are using is 5.7.0. When we are trying to run this script using ant we are getting below error:
[java] WARN [main] [ProtocolConfiguration] variable "${hybris.datasource.jndi.name}" in JDBC_PING could not be substituted; datasource_jndi_name is removed from properties [java]
ERROR [AfterSaveEventPublisher-master] [CronJobManager] cannot start task engine since task service does not provide engine handle [java] WARN [main] [Configurator] JGRP000014: TP.discard_incompatible_packets has been deprecated: incompatible packets are discarded anyway [java]
WARN [main] [Configurator] JGRP000014: TP.enable_bundling has been deprecated: will be ignored as bundling is on by default
We are getting single instance of this error and also build successful in the logs but we are unable to see the changes in loglevel of the classes in HAC which we are expecting after the script run.
We have placed this script in platform folder and tried below command :
. ./setantenv.sh && ant executeScript -Dresource=loglevel.groovy
Also we tried to place this in home folder and exceuted below command : .
. ./setantenv.sh && ant executeScript -Dresource=/home/appuser/loglevel.groovy (appuser is assigned user for hybris)
Can someone please help us with how to execute this script using ant command.
Request clarification before answering.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.