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

  • Home
  • SEARCH
  • 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 242941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:52:47+00:00 2026-05-11T20:52:47+00:00

I have a stupid java logging problem: I’m loading the logging configuration from my

  • 0

I have a stupid java logging problem: I’m loading the logging configuration from my app configuration file – but it just doesn’t log anything after reading the file (which looks pretty much like the examples you will find on the net except for the additional application configuration – removing this also doesn’t help). The “initializing…” log line appears just fine, but the “starting app” and any further messages are neither logged to the console, nor is the logfile ever created. What am I missing here?

The Logger code looks like this:

...
Logger log = Logger.getLogger("myApp");
log.setLevel(Level.ALL);
log.info("initializing - trying to load configuration file ...");

Properties preferences = new Properties();
try {
    FileInputStream configFile = new FileInputStream("/path/to/app.properties");
    preferences.load(configFile);
    LogManager.getLogManager().readConfiguration(configFile);
} catch (IOException ex)
{
    System.out.println("WARNING: Could not open configuration file");
    System.out.println("WARNING: Logging not configured (console output only)");
}
log.info("starting myApp");
...

And this is the configuration file:

appconfig1 = foo
appconfig2 = bar

# Logging
handlers = java.util.logging.FileHandler, java.util.logging.ConsoleHandler
.level = ALL

# File Logging
java.util.logging.FileHandler.pattern = %h/myApp.log
java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter
java.util.logging.FileHandler.level = INFO

# Console Logging
java.util.logging.ConsoleHandler.level = ALL
  • 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-11T20:52:47+00:00Added an answer on May 11, 2026 at 8:52 pm

    Okay, first intuition is here:

    handlers = java.util.logging.FileHandler, java.util.logging.ConsoleHandler
    .level = ALL
    

    The Java prop file parser isn’t all that smart, I’m not sure it’ll handle this. But I’ll go look at the docs again….

    In the mean time, try:

    handlers = java.util.logging.FileHandler
    java.util.logging.ConsoleHandler.level = ALL
    

    Update

    No, duh, needed more coffee. Nevermind.

    While I think more, note that you can use the methods in Properties to load and print a prop-file: it might be worth writing a minimal program to see what java thinks it reads in that file.

    Another update

    This line:

        FileInputStream configFile = new FileInputStream("/path/to/app.properties"));
    

    has an extra end-paren. It won’t compile. Make sure you’re working with the class file you think you are.

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

Sidebar

Ask A Question

Stats

  • Questions 155k
  • Answers 155k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I'm pretty sure that someone will answer this better, but… May 12, 2026 at 10:43 am
  • Editorial Team
    Editorial Team added an answer Unless I misinterpreted your question, try event.preventDefault(); in your mousedown… May 12, 2026 at 10:43 am
  • Editorial Team
    Editorial Team added an answer This should be a response to Adam's comment. If you… May 12, 2026 at 10:43 am

Related Questions

I have a stupid java logging problem: I'm loading the logging configuration from my
I have a large Java app that is split up into multiple projects. Each
I have written a simple Java dispatcher with a daemon thread to handle the
In my Java code, I occasionally run into situations where I have to catch
I have a bunch of pretty large CSV (comma separated values) files and I

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.