How can I make Apache httpcomponents use log4j?
===

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. 