Hybris cronjob logging Code Answer

Hello Developer, Hope you guys are doing great. Today at Tutorial Guruji Official website, we are sharing the answer of Hybris cronjob logging without wasting too much if your time.

The question is published on by Tutorial Guruji team.

I have Job with logger (Slf4j) :

Job Class :

public class MyJob extends AbstractJobPerformable<CronJobModel>
    private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass().getName());

    public PerformResult perform(CronJobModel cronJobModel)
         LOG.info("Test log);

I want this log to appear in the job log(in hmc). But it doesn’t exist there. But logger logs all stuff to console. Please see below my job Configuration

Job Configuration:

Job Configuration


The problem in your case is the type of logger which you use Logger(slf4j). So to get logs entries you need to use org.apache.log4j.Logger as your main Logger. Hybris recommaned org.apache.log4j.Logger as Log4j framework to use. So add this lines to your class :

  • import the package :

    import org.apache.log4j.Logger; 
We are here to answer your question about Hybris cronjob logging - If you find the proper solution, please don't forgot to share this with your team members.

Related Posts

Tutorial Guruji