简体   繁体   中英

Console.log in a Java Back-end

I'm using Java with Spring Boot in IntelliJ Community edition. I usually use console.log() in the front-end to debug my code and see the value of a variable. Here in the back-end I try to do the same using System.out.println . For example

System.out.println("page is" + query.page());
return dslContext.select(...

I'm looking at the IntelliJ terminal but not getting anything back there.

You can use the logger from java.util.logging.Logger

    private static final long serialVersionUID=1L;
    public static Logger logger=Logger.getLogger("global");
    //do some
    logger.info("page is"+query.page());

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM