简体   繁体   中英

Where can I see my log4j logs in a Servlet?

I have a Servlet and I wanted to log a message using log 4j, like this:

private static Logger logger = Logger.getLogger("DownloadServlet.class");
logger.info("Hello");

But I cannot find the log anywhere? Where is it saved? I am using a Tomcat server.

It is logging in your console, while you running the project. Your code is not saving logs to files.

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