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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:41:21+00:00 2026-06-12T10:41:21+00:00

The server is a simple jetty Server How to set the log4j.properties file i

  • 0

The server is a simple jetty Server

How to set the log4j.properties file i have a proper log4j properties file,

but while setting the log4j.properties

using the following manner, i have the log4j.properties in my src folder

PropertyConfigurator.configure("log4j.properties");

it works fine when i am working locally, but when i create a jar file and run its throwing an exception like java.io.FileNotFoundException:

i have tried extracting it and created it in another folder called resources and tried accessing that by the following method

PropertyConfigurator.configure("resources/log4j.properties");

even after that its showing the same error

how to export the entire project as a jar file and make this log4j problem to work?

Found another link
Log4j Properties in a Custom Place

and in that it is required to set the class path

java -Dlog4j.configuration=conf/log4j.properties -classpath ...

Do not know how to set the -classpath and dont know whether this method will work!!

And even if its exported as a jar file it should work!

  • 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-12T10:41:22+00:00Added an answer on June 12, 2026 at 10:41 am

    If the log4j.properties resource directory is on the classpath, you could use:

    PropertyConfigurator.configure("classpath:resources/log4j.properties");
    

    To see the working directory for Jetty, you could add:

    System.out.println(System.getProperty("user.dir"));
    

    before the PropertyConfigurator.configure statement. This would allow you to see where the property file is located in relation to the server’s working directory.

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

Sidebar

Related Questions

Simple task. I'm using the websockets server implementation by jetty, and I have to
I have installed Apache Axis2 1.6.1 in a Jetty 8.0.4 web server, but JSON
I am using Solr 3.5.0 with the example server under jetty-6.1-SNAPSHOT. I have started
The setup: I have a Jetty (8.1.5 if it matters) Server running a simple
I'm currently building a simple REST interface using Jersey with embedded Jetty. Server server
I have a simple server in Sinatra, like require 'sinatra/base' class Server < Sinatra::Base
I am writing a simple server using select to monitor multiple sickets. Here's my
I'm trying to set up a simple server side RSA encryption of a small
I've set up a simple Eclipse 3.5/Jetty 6.1 web app which returns hello world.
Using Embedded Jetty I am trying to get a very simple servlet to forward

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.