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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:13:13+00:00 2026-06-13T08:13:13+00:00

Has someone experience with log4j and knows what the constructor () is not visible

  • 0

Has someone experience with log4j and knows what “the constructor () is not visible means” ?

Here’s the code for the Main-class:

import org.apache.log4j.xml.DOMConfigurator;
import stdGame.*;
public class Main {
  public static void main(String[] args) {
      DOMConfigurator.configureAndWatch( "data/log/myLoggerConfig.xml", 60*1000 );
      new LogTest();
    }
}

The LogTest-class is located in stdGame-package, which is already imported as you can see.
The code is working as desired, when placing the LogTest-class in the same package as the Main-class.
Here is the code for the LogTest()-class:

package stdGame;
import org.apache.log4j.Logger;
public class LogTest {
    private static Logger logger = Logger.getLogger(LogTest.class);
    LogTest() {
        logger.info("My info-msg in LogTest.");
        logger.error("My error-msg in LogTest.");
    }
}

Try placing them into the same package, the error message will disapear. But i need them placed into seperated packages.

Finally this is the myLoggerConfig.xml-file:

  <?xml version="1.0" encoding="UTF-8" ?>
  <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
  <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
  <appender name="MeinAppender" class="org.apache.log4j.DailyRollingFileAppender">
  <param name="datePattern" value="'.'yyyy-MM-dd_HH-mm" />
  <param name="file" value="data/log/myLogfile.log" />
  <param name="Append" value="true" />
  <layout class="org.apache.log4j.PatternLayout">
  <param name="ConversionPattern" value="%d{ISO8601} %-5p [%t] %c: %m%n" />
  </layout>
  </appender>
  <root>
  <priority value="INFO" />
  <appender-ref ref="MeinAppender" />
  </root>
  </log4j:configuration>
  • 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-13T08:13:14+00:00Added an answer on June 13, 2026 at 8:13 am

    Your class LogTest is in stdName package and it’s constructor has package-private access. It seems Main class is in some package other than stdName and so the compiler is complaining that LogTest() constructor is not visible in Main‘s package. Change the constructor of LogTest to public.

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

Sidebar

Related Questions

Has someone here ever had experience with the D programming language ? It seems
A long shot but here's hoping someone has some experience coding PHP hooks for
It may be a bit too specific, but maybe someone here has experience extending
Someone has to be able to explain what I'm doing wrong here! I'm trying
hoping someone has experience with both sql server and postgresql. Between the two db's,
I'd like to know whether someone has any experience with XQuery as it is
We are wondering if someone has experience with the way Qt license works. We
I hope if someone has a bit of experience in MATLAB than I do
Has someone experience with database comparison tools? Which one you would recommend? We are
Hoping someone has experience in both community server 2008 and TS 5.0 What are

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.