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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:07:13+00:00 2026-05-26T12:07:13+00:00

I am using commons logging for my application running on Glassfish V3.1(I am new

  • 0

I am using commons logging for my application running on Glassfish V3.1(I am new to glassfish). I have different applications running on Glassfish under ../domain1 folder(Developers machine). I am using an XML to configure Logging.Following is the my xml config

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd" >
<log4j:configuration>
    <appender name="file"
        class="org.apache.log4j.RollingFileAppender">
        <param name="maxFileSize" value="100KB" />
        <param name="maxBackupIndex" value="5" />
        <param name="File" value="/home/phanikumar/Desktop/debug.log" />
        <param name="threshold" value="debug"/>
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern"
                value="%d{DATE} %5p %c{1}:%L - %m%n" />
        </layout>
        <filter class="org.apache.log4j.varia.LevelRangeFilter">
            <param name="LevelMin" value="warn" />
            <param name="LevelMax" value="fatal" />
        </filter>

    </appender>
     <logger name="com">
        <level value="DEBUG" />     
        <appender-ref ref="file"/>
    </logger>

    <root>

        <appender-ref ref="file" />

    </root>
</log4j:configuration>

In this config file I have explicitly mentioned the file to be in a specific location but it never did.Is there any problem with the logger file?Am I missing some thing?

or

Is there any way that I can configure my logs to be in a specific location? I have seen the server.log file and it is unsuitable for my requirement as the logs of all applications are logged in a same file.

Please kindly help me.

  • 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-26T12:07:14+00:00Added an answer on May 26, 2026 at 12:07 pm

    SOLUTION

    Add a Properties file named commons-logging.properties in the class path.

    And add the following property

    org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger

    This initializes Logging to Log4j Logger

    Then it works perfectly.

    EDIT:
    Usually, by default commons logging searches for loggers like log4j. If the above solution doesnt work, one needs to check if the commons-logging jar file is corrupted i.e, check if the class files like org.apache.commons.logging.impl.Log4jLogger is present.

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

Sidebar

Related Questions

We are using apache commons logging in our application for all our logging requirements.
I am using Apache Common Logging in Desktop Application. private static final Log log
I'm using Apache Commons Logging and SLF4J with log4j, but I also want to
I'm using apache commons library and log4j. I have an xml configuration file and
I am using Apache Common Logging library in my standalone application. After searching through
My java application uses log4j for logging. Using ant the project builds successfully, but
I have developed demo application using spring struct and hibernate and getting following error
I have an application which can only have 1 instance running at each time,
I've started using SmartInspect in my Delphi applications because my users were running into
greetings all i have a web application using (spring-hibernate) frameworks and when tried to

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.