Reputation: 1189
No source code is available for type org.apache.log4j.Logger; did you forget to inherit a required module?
I want to create a logfile.
So I added log4j 1.2.16
and did build Path
in log4j.properties wote code for consoleappender and rolling file.
in the Myclass
private static Logger logger = Logger.getLogger(Myclass.class);
When i run the xeb application i get an error
No source code is available for type org.apache.log4j.Logger; did you forget to inherit a required module?
Then in Myproject.gwt.xml i write this code
<inherits name="org.apache.log4j"/>
then i run my web applicaton *I can't see the URL in developmentMode"
Upvotes: 2
Views: 4812
Reputation: 1336
LOG4J Doesn't Support GWT because LOG4J is used in Java/J2EE Apps Mainly for Console/File Logging. In case of GWT, the Java code you write down is actually compiled to JavaScript by the GWT Compiler. In that Case, the script won't be able to identify the logger type. I think you can use it for Server Package.
Try the Following Links for GWT Native Logging (This is Similar to console.log())
http://code.google.com/webtoolkit/doc/latest/DevGuideLogging.html
This API is also good in Logging for GWT. I recommend this
http://code.google.com/p/gwt-log/
Upvotes: 6
Reputation: 4485
Log4j uses IO classes that are not emulated in the GWT library. Also you would need to provide the log4j source code within the build path.
While gwt-log is nice, GWT has built in java.util.logging emulation. see http://code.google.com/webtoolkit/doc/latest/DevGuideLogging.html for details.
Upvotes: 2
Reputation: 3240
I don't think GWT supports log4j at the client side yet. You can use gwt-log for this purpose.
Upvotes: 1