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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T14:28:05+00:00 2026-05-20T14:28:05+00:00

could anybody explain to me, how to set up java Logger for various classes

  • 0

could anybody explain to me, how to set up java Logger for various classes from a concrete package ?

for example:
if I get this one and set it up

Logger logger = Logger.getLogger("com.google.api.client.*");
        logger.setLevel(Level.CONFIG);
        logger.addHandler(new Handler() {

            @Override
            public void close() throws SecurityException {
            }

            @Override
            public void flush() {
            }

            @Override
            public void publish(LogRecord record) {
                // default ConsoleHandler will take care of >= INFO
                if (record.getLevel().intValue() < Level.INFO.intValue()) {
                    System.out.println(record.getMessage());
                }
            }
        });

there are conditions like this

Logger.getLogger(HttpTransport.class.getName()).isLoggable(Level.CONFIG);

in the library where HttpTransport is part of com.google.api.client.*

But the problem is, that

Logger.getLogger(HttpTransport.class.getName()).isLoggable(Level.CONFIG); 

is false … like if a different logger was obtained

How else should I set it for all classes from the same package? if there are conditions for loggers for concrete classes like HttpTransport.

  • 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-20T14:28:05+00:00Added an answer on May 20, 2026 at 2:28 pm

    You do not want the .* in your package string.
    Change

    Logger logger = Logger.getLogger("com.google.api.client.*");
    

    to

    Logger logger = Logger.getLogger("com.google.api.client");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Could anybody explain what is the cause of the following: >>> from M2Crypto import
Can anybody please explain how this could possibly happen? I am completely aware of
Could anybody explain what does this contain: ds.Tables[0].Rows[0][0]
Could anybody explain me what's the difference with setactivewindow with setforegroundwindow (using pinvoke from
Could anybody explain what's the problem with listeners in this code? I just started
Could anybody explain in plain words how Cloud computing works? I have read the
Could anybody explain to me the process of uploading to and downloading form and
Could anybody explain why the static property is null? class Program { static void
Could anybody help with this? I am trying to integrate a coupon function into
Could anybody explain me following situation with Scala implicit conversions mechanism. There is a

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.