Posts

Showing posts with the label help hybris

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?

[Solved] Solr error while hybris server startup

Scenario Getting  error creating a bean with name 'defaultSolrServerService' , while Hybris server startup? Error creating bean with name 'defaultSolrServerService' defined in class path resource [global-solrserver-spring.xml]: Invocation of init method fa ing Solr start command for instance: [name: default, port: 8983] ... Solr server not yet started for instance: [name: default, port: 8983] [retry: 7, interval: 5000ms] Root cause OOTB (post hybris v5.5) default solr configuration ensures that a standalone Solr server is configured, started and stopped together with the platform. When we use  ctr + c  to stop the Hybris instance it should also stop the solr instance. But sometime solr instance not stopped properly with it and again we try to start the Hybris server, which internally tries to instantiate solr server (which already running) again and that leads to such errors. Troubleshoot steps to solve your issue 1. Stop and start Hybris server aga

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

Image
Scenario Sometimes 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 the Hybris server. Solution If your hybris version > v6 you can easily do this by navigating hac/platform/log4j . Here you can add your full class package and the log level you want.  In the older hybris version, you can do the same using 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 logCla