[jboss-user] [Beginner's Corner] - log4j

Red Militante do-not-reply at jboss.com
Thu Nov 17 18:35:54 EST 2011

Red Militante [http://community.jboss.org/people/redmond007] created the discussion


To view the discussion, visit: http://community.jboss.org/message/637095#637095

I'm running into problems trying to add log4j logging to one of my classes.  This is part of an application deployed in JBoss as7 7.0.0-Final.

I add the following lines to my class

import org.apache.log4j.Logger;

public class Requests extends LEServlet
               private static final Logger logger = Logger.getLogger(Requests.class);


                       logger.info("data:" + ID + ":" + sessionLogID + ":" + queueID + ":" + uuid);

When I try to compile my code I get 

[ERROR] /Users/red/Documents/hg/myappAnywhere-maven/src/main/java/com/mycompany/myapp/Requests.java:[27,23] package org.apache.log4j does not exist
[ERROR] /Users/red/Documents/hg/myappAnywhere-maven/src/main/java/com/mycompany/myapp/Requests.java:[31,22] cannot find symbol
[ERROR] symbol  : class Logger
[ERROR] location: class com.mycompany.myapp.Requests

I have a log4j.properties in my src/main/resources/META-INF folder

log4j.rootLogger=WARN, A1
# Or log only errors, even less verbose
# log4j.rootLogger=ERROR, A1

# Print the date in ISO 8601 format
log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n

and a log4j dependency in my MANIFEST.MF

Manifest-Version: 1.0
Dependencies: org.apache.log4j 

Not sure why I'm getting these errors.  Any advice welcome.

Reply to this message by going to Community

Start a new discussion in Beginner's Corner at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20111117/84424b27/attachment.html 

More information about the jboss-user mailing list