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 8475875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:01:00+00:00 2026-06-10T18:01:00+00:00

I am starting new with Struts2. Using sl4j for logging in HelloWorld example. No

  • 0

I am starting new with Struts2. Using sl4j for logging in HelloWorld example. No log file is created and nothing in console.

Someone help me what I am doing wrong?

Below is my project structure.

Logging

Properties File

# Default Logging Level is DEBUG. levels: DEBUG < INFO < WARN < ERROR < FATAL OR ALL. Its only appender to FILE.

# Root logger option
log4j.rootLogger = ALL, FILE, stdout

# Define the file appender
# log4j.appender.FILE=org.apache.log4j.FileAppender

# backup the log files when they reach a certain size
log4j.appender.FILE=org.apache.log4j.RollingFileAppender

# Set the name of the file
log4j.appender.FILE.File=C:\\test.log

# Specify the log file size and max backup index.
log4j.appender.Logger.MaxFileSize=5mb
log4j.appender.Logger.MaxBackupIndex=20

# Set the threshold to debug mode
log4j.appender.FILE.Threshold=DEBUG

# Set the append to false, overwrite
log4j.appender.FILE.Append=false

# Define the layout for file appender
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE.layout.conversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n

# log4j.rootLogger = ALL, FILE, stdout
# Output To Console: Direct log messages to stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n

Strust.xml

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
    "http://struts.apache.org/dtds/struts-2.3.dtd">

<struts>
    <constant name="struts.devMode" value="true" />

    <package name="default" extends="struts-default">
        <action name="HelloWorld" class="vaannila.HelloWorld">
            <result name="SUCCESS">/success.jsp</result>
        </action>
    </package>
</struts>
  • 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-06-10T18:01:02+00:00Added an answer on June 10, 2026 at 6:01 pm

    You need three jars in the deployed app’s classpath, which for the WAR is WEB-INF/lib. You need:

    1. The slf4j interfaces that your code uses when logging
    2. An actual logging framework that does the logging
    3. The “binding” of that underlying framework to those slf4j interfaces

    These things map, respectively, the following 3 jars, assuming log4j 1.2.x as the underlying framework.

    1. slf4j-log4j12.jar
    2. slf4j-api.jar
    3. log4j12.jar

    Also note that the slf4j documentation is thorough and to the point.

    http://www.slf4j.org/manual.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How to improve our productivity when starting new project using Delphi? For me, I
Starting a new project using EJB 3 / JPA, mainly stateless session beans and
Is there way of creating empty .mo file? Usually when starting new project I
Starting a new project and redefining the logging utilities. With the popularity of Log4J
whet i am starting new Activity using this way below Intent edit = new
I am junior programmer and now we are starting new project using Rational Rhapsody
Can someone tell me why the code from Starting new code onwards does not
I'm starting new project. The client interface is based on GWT (and GXT) I
Can I avoid third party code from creating new threads, starting new VMs, or
Starting a new rails project and we have a well-thought-out color palette, and want

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.