facebook

MyEclipse not reading log4j.properties

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MyEclipse Archived
  2.  > 
  3. Application Servers and Deployment
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #270070 Reply

    Ramin
    Member

    Hi,

    I use MyEclipse 5.1 and Java 1.5, but apparently my log4j.properties is not read and the log level defaults to INFO level.

    I placed my properties file (listed below) in the /src of my Web project.

    I even set the following flags in Windows > Preferences > Tomcat 5 > JDK

    -Dlog4j.debug -Dlog4j.configuration=${workspace_loc}/log4j.properties
    
    
    Neither take effect. The other possibility is that the log4j.properties is not correct!!!
    
    Regards,
    Ramin
    
    
    
    log4j.rootLogger=ALL, stdout, file
    ### direct log messages to stdout ###
    log4j.appender.stdout=org.apache.log4j.ConsoleAppender
    log4j.appender.stdout.Target=System.out
    log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
    log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
    
    ### direct messages to file tl.log ###
    log4j.appender.file=org.apache.log4j.FileAppender
    # Windows
    log4j.appender.file.File=C:/TL/workspace/TLWeb/WebRoot/WEB-INF/tl.log
    # Unix Server
    #log4j.appender.file.File=/home/sportlog/tmp/tl.log
    log4j.appender.file.layout=org.apache.log4j.PatternLayout
    log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
    
    # To log for specific package/class: log4j.logger.<path>=<LEVEL>
    #log4j.logger.com.tl=FINEST
    

    [/quote]

    #270096

    Riyad Kalla
    Member

    Ramin,
    Is the logger even working? Meaning is your tl.log file getting updated at all?

    I don’t think you should need to specify the log4j.properties the way you have, simply having it on your classpath should work for your webapp.

    #270202

    Ramin
    Member

    Hi Riyad,

    the default logging to the console at Ithe default level of INFO is working.
    But no tl.log file. It is not created anywhere.

    aparently, it is not read at all.

    Ramin

    #270240

    Riyad Kalla
    Member

    Hmm… can you go to your Tomcat connector preferences, and go to the Paths panel, then try and add the dir with the log4j file directly to the classpath?

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: MyEclipse not reading log4j.properties

You must be logged in to post in the forum log in