Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3277626
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:23:24+00:00 2026-05-17T19:23:24+00:00

My project runs on Wicket+Spring+JPA/Hibernate. When I run it using the command: mvn jetty:run

  • 0

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>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T19:23:25+00:00Added an answer on May 17, 2026 at 7:23 pm

    Since you use SLF4-to-log4j bridge, you need to configure logging in log4j configuration.

    To configure log4j logging with Spring you need to add the following to web.xml (before ContextLoaderListener):

    <listener>
        <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
    </listener>
    

    Then configure log4j in /WEB-INF/log4j.xml (you may also use traditional log4j.properties):

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE log4j:configuration PUBLIC "-//APACHE//DTD LOG4J 1.2//EN" "log4j.dtd">
    <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
        <!-- Appenders -->
        <appender name="console" class="org.apache.log4j.ConsoleAppender">
            <param name="Target" value="System.out" />
            <layout class="org.apache.log4j.PatternLayout">
                <param name="ConversionPattern" value="%-5p: %c\n\t%m%n" />
            </layout>
        </appender>
    
        <logger name="... your package ...">
            <level value="info" />
        </logger>
    </log4j:configuration>
    

    See also:

    • Log4jConfigListener javadoc
    • log4j.xml syntax
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have setup an android test project that runs junit tests. It's using two
I would like to use Wicket on my new project but my client is
I'm Trying to deploy my winforms project using installshield in order to make is
I am deploying my first ASP MVC project. The project runs just fine, I
I have a project that runs on both .NET and .NET CF. But it
I have a django project that runs on a Linux server, and I've been
I have a large project that runs on an application server. It does pipelined
I have a simple Scala project that runs without any problems inside Eclipse, however,
I've a ASP.NET MVC 2 project that runs fine under Windows 7 and will
I have a .NET 4.0 C# solution with a tests project which runs unit

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.