My project runs on Wicket+Spring+JPA/Hibernate. When I run it using the command:
mvn jetty:run
I'd like jetty to print logs I make in the code. I have for example the following DAO implemented:
@Repository(value = "isinDao")
public class IsinDaoJpa implements IsinDao {
@PersistenceContext
private EntityManager em;
private static Logger logger = LoggerFactory.getLogger(IsinDaoJpa.class);
public Isin findById(Long id) {
return em.find(Isin.class, id);
}
public List findAll() {
Query query = em.createQuery("select e from Isin e");
logger.info("DAO: All ISINs selected");
return query.getResultList();
}
}
How do I make Jetty print this information real-time into the command line window?
In pom.xml, I have the following dependencies:
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.4.2</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
</dependency>