Posts

Showing posts with the label How to

How to add you custom class in HAC logging list?

Scenario Hybris use  log4j2 logger . We can change the log level for preconfigured classes from the HAC > Platform > Loggin (like root , org.springframework etc.). But what if we want to configure logger for our custom class. Solution Add logger statement in your java class add log4j2 configuration for your custom Java class Restart the Hybris server MyService.Java private static final Logger LOG = Logger.getLogger(MyService.class); LOG.debug("I am debug log"); local.properties \#log4j2 configuration log4j2.rootLogger.level = warn log4j2.logger.myService.name = com.extended.service.impl.MyService log4j2.logger.myService.level = warn log4j2.logger.myService.appenderRef.stdout.ref = STDOUT log4j2.logger.customService.name = com.extended.service.impl.CustomService log4j2.logger.customService.level = warn log4j2.logger.customService.appenderRef.stdout.ref = STDOUT Do you know this also can be done  without restarting Hybris server?

How to Integrate Google Enhanced Ecommerce with Hybris

How to implement Universal Analytics (UA) Enhanced Ecommerce features using Google Tag Manager on a Hybris? We already have successfully implemented Enhanced E-commerce (Integrating Google Analytics) for many of Hybris sites. This will be paid service. contact@helphybris.com

How to install a standalone Solr server in SAP Hybris?

In this post, you will learn how to install and configure a standalone Solr server in a way that can be used in SAP Hybris Commerce. Prerequestion solrserver  extension should be there in your  localextensions.xml  file Hybris OOTB Solr configuration background The default configuration is as follows: solrserver . instances . default . autostart = true solrserver . instances . default . mode = standalone solrserver . instances . default . hostname = localhost solrserver . instances . default . port = 8983 solrserver . instances . default . memory = 512m Here, you can see  autostart=true  which tell Solr server to start and stop together with the Hybris platform. In another word, we can say default configuration ensures that a standalone Solr server is configured, started and stopped together with the platform. Setup external Standalone Server As we have seen, OOTB (post hybris v5.5) solr server is already configured as standalone server  mode=standalone . It mean

How to change class log level in Hybris without restarting server?

Scenario Sometime to debug the production issue, we want to enable log level for certain classes which were not configured in local.properties and we hope we could do it without restarting Hybris server. Solution Your hope will come true. Yes, we can do it simply through the groovy script. Go to HAC > Console > Scripting language Past the below groovy script change your full class in setLogger method setLogger("de.hybris.platform.jalo.flexiblesearch.FlexibleSearch", "DEBUG"); execute the script import org.apache.logging.log4j.*; import org.apache.logging.log4j.core.config.*; import de.hybris.platform.util.logging.log4j2.HybrisLoggerContext; //Example setLogger("de.hybris.platform.jalo.flexiblesearch.FlexibleSearch", "DEBUG"); public String setLogger(String logClass, String logLevel ) { final HybrisLoggerContext loggerCtx = (HybrisLoggerContext) LogManager.getContext(false); final Configuration loggerC