Logging equivalent in Java

Enonic version: 6,10,1
OS: Centos 6

Hi,

In JS: log.info(…)
What is the equivalent in Java. I’m writing custom Java code and would like to log in the same way as log.info().in JS.

Thanks.

You can use SLF4J Logger:

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class MyClass {

  private final static Logger LOG = LoggerFactory.getLogger( MyClass.class );

  void doSomething() {
     LOG.info( "Something happened" );
...
2 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.