L
L
Loligan2016-04-07 17:28:12
Java
Loligan, 2016-04-07 17:28:12

Why doesn't it display messages in Catalina when logging?

I'm trying to do logging in a Maven project using Servelet and Tomcat (I use IDEA for this).

public class One extends HttpServlet {
    private static final Logger log = Logger.getLogger(One.class.getName());
    {
        log.info("FUUUUUUK");
    }
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        log.info("FUUUUUUUUUUUUUUU");
        super.doGet(req, resp);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        log.info("FFFFFFFFFFFFFFFF");
        super.doPost(req, resp);
    }
}

index.jsp
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title></title>
</head>
<body>
<h1>hi</h1>
<form action="hi" method="GET">
  <input type="submit" value="hi hi">
  ${log}
</form>
</body>
</html>

I tried to connect Log4j but again, no use. No information in catalina, no file. I already despaired, nothing comes out with logging.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question