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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:57:01+00:00 2026-06-08T12:57:01+00:00

My log4j.properties file looks like this: # Root logger option log4j.rootLogger=DEBUG, file # Direct

  • 0

My log4j.properties file looks like this:

# Root logger option
log4j.rootLogger=DEBUG, file

# Direct log messages to a log file
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=/home/user/logs/myapp.log
log4j.appender.file.MaxFileSize=10MB
log4j.appender.file.MaxBackupIndex=1
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%5p [%c] %m%n

log4j.logger.org.apache.http=DEBUG

The file myapp.log is created, and my http requests are executing, but the log file remains empty and I have no idea why.

edit: in the class that is using HttpClient, I was able to log messages there. So it makes me think the log4j.logger.org.apache.http line is wrong even though that’s what the documentation on http://hc.apache.org/ tells you to do.

  • 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-08T12:57:02+00:00Added an answer on June 8, 2026 at 12:57 pm

    I had a similar problem in my Grails app and it required that I declare my config in a specific order. I had to declare my debug filters, my appenders and then my root loggers in that specific order. I included my config below for your reference. I hope this helps you.

    def logLayoutPattern = new PatternLayout("%d [%t] %-5p %c %x - %m%n")
    
    debug 'grails.app.controllers.com.sagebauer'
    debug 'grails.app.services.com.sagebauer'
    
    error 'org.codehaus.groovy.grails.web.servlet', // controllers
            'org.codehaus.groovy.grails.web.pages', // GSP
            'org.codehaus.groovy.grails.web.sitemesh', // layouts
            'org.codehaus.groovy.grails.web.mapping.filter', // URL mapping
            'org.codehaus.groovy.grails.web.mapping', // URL mapping
            'org.codehaus.groovy.grails.commons', // core / classloading
            'org.codehaus.groovy.grails.plugins', // plugins
            'org.codehaus.groovy.grails.orm.hibernate', // hibernate integration
            'org.springframework',
            'org.hibernate',
            'net.sf.ehcache.hibernate'
    appenders {
        appender new ConsoleAppender(name: "console",
                threshold: log4jConsoleLogLevel,
                layout: logLayoutPattern
        )
    }
    
    root {
        error 'console'
        additivity = true
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following log4j.properties file: log4j.rootLogger=DEBUG,A1,A2,A3 log4j.appender.A1=org.apache.log4j.RollingFileAppender log4j.appender.A1.Threshold=DEBUG log4j.appender.A1.File=log.out log4j.appender.A1.MaxFileSize=100KB log4j.appender.A1.MaxBackupIndex=1 log4j.appender.A1.layout=org.apache.log4j.PatternLayout log4j.appender.A1.layout.ConversionPattern=%p
I implemented log4j logging in my JSF application.My log4j.properties file is like this log4j.rootLogger=DEBUG,
Here is my log4j.properties file # Set loggers' levels log4j.rootLogger=warn, trace_file # Appender log4j.appender.trace_file=org.apache.log4j.RollingFileAppender
My log4j.properties file - log4j.rootLogger=INFO, stdout # =============== console output appender ===================== log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
I have following information in log4j.properties file.. log4j.appender.file = org.apache.log4j.DailyRollingFileAppender log4j.appender.file.File = C:\\app\\file.log log4j.appender.file.Threshold
I've set my log4j.properties file to this configuration below log4j.rootLogger=INFO, CATALINA # Define all
My procedure for using log4j is this: put a .properties file somewhere in a
I finally got log4j setup with spring mvc, my log4j properties looks like: #
This is my above log4j.properties file , log4j.rootCategory=Info, A1 # A1 is a DailyRollingFileAppender
I have a java app, and the log4j.properties file is in src/com/my/path/props. On compile,

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.