mercredi 25 novembre 2020

Log statement of Java Class must be printed while starting Application Server [closed]

How to print the log statement of java class while starting the application server... How can it be implemented... I have already written Hello World using PrimeFaces

import java.util.logging.Logger;
import javax.annotation.PostConstruct;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Named;

@Named
@ApplicationScoped
public class HelloWorld {
    
    private final static Logger LOGGER = Logger.getLogger(HelloWorld.class.getName());
    
    private String value = "This editor is provided by PrimeFaces";

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }
    
    @PostConstruct
    public void test(){
        LOGGER.info("Application Starting....");
    }

}

The LOGGER.info() must printed while starting the application Server.




Aucun commentaire:

Enregistrer un commentaire