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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T11:54:34+00:00 2026-06-07T11:54:34+00:00

I am using the default java.util.Logging API to print information to my log. Logger.getLogger(Datastore.class.getName());

  • 0

I am using the default java.util.Logging API to print information to my log.

Logger.getLogger(Datastore.class.getName());
logger.info("Registering ");

where Datastore is the name of the class.But I am unable to find where the logs are stored. I am running on a Windows 7 machine and the above program is a part of a servlet. I apologize for the seemingly stupid question, but sometimes such insignificant things greatly hinder progress.

  • 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-07T11:54:36+00:00Added an answer on June 7, 2026 at 11:54 am

    By default the java.util.logging.Logger sends output to the console and aren’t printed to a file. You will have to add a java.util.logging.Handler to the Logger.
    Below are snippets to create Handlers of HTML, TEXTFILE. Hope this helps.

    package logging;
    
    import java.io.IOException;
    import java.util.logging.FileHandler;
    import java.util.logging.Formatter;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import java.util.logging.SimpleFormatter;
    
    public class MyLogger {
        static private FileHandler fileTxt;
        static private SimpleFormatter formatterTxt;
    
        static private FileHandler fileHTML;
        static private Formatter formatterHTML;
    
        static public void setup() throws IOException {
            // Create Logger
            Logger logger = Logger.getLogger("");
            logger.setLevel(Level.INFO);
            fileTxt = new FileHandler("Logging.txt");
            fileHTML = new FileHandler("Logging.html");
    
            // Create txt Formatter
            formatterTxt = new SimpleFormatter();
            fileTxt.setFormatter(formatterTxt);
            logger.addHandler(fileTxt);
    
            // Create HTML Formatter
            formatterHTML = new MyHtmlFormatter();
            fileHTML.setFormatter(formatterHTML);
            logger.addHandler(fileHTML);
        }
    } 
    

    For further reference read this article.

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

Sidebar

Related Questions

I am currently using Logger from Java.Util, The default behavior for logger.info is like
I'm using the Java default logger, and right now it's printing a lot of
I have a java program which is using the default XML logging as no
I am using java.util.logging to do all the logging of my application. Until recently,
I am using java/morphia to deal with mongodb. The default ObjectId is not very
I have created zip file using java as below snippet import java.io.*; import java.util.zip.*;
I have two property files in my default package (I'm using NetBeans): commons-logging.properties with
I've added a human-readable configuration file to my app using java.util.Properties and am trying
I'm trying to map java.util.Date to postgresql timestamp without time zone type. I'm using
I'm unable to adjust java logging's logging level. I'm using maven surefire (mvn test),

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.