From a1258d875c22ee4b3d666ab6fdb9178a6e5136ad Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Mat=C3=A8rne?= For more information about configuring Log4J see its
documentation page.Using the Log4j 1.2 Bridge
+You could use the Log4j Bridge
+if your application is written against the Log4j (1.x) API, but you want to use the Log4j 2.x runtime.
+For using the bridge with Ant you have to add
+
+
+to your classpath (e.g. via the -lib
option).
+Translating the 1.x properties file into the 2.x xml syntax would result in
+
+
+
+<?xml version="1.0" encoding="UTF-8"?>
+<Configuration status="WARN">
+ <Appenders>
+ <File name="file" fileName="build.log">
+ <PatternLayout>
+ <Pattern>[%6r] %8c{1} : %m%n</Pattern>
+ </PatternLayout>
+ </File>
+ </Appenders>
+ <Loggers>
+ <Root level="ERROR">
+ <AppenderRef ref="file" level="DEBUG"/>
+ </Root>
+ <Logger name="org.apache.tools.ant.Project" level="INFO"/>
+ <Logger name="org.apache.tools.ant.Project" level="INFO"/>
+ <Logger name="org.apache.tools.ant.taskdefs" level="INFO"/>
+ <Logger name="org.apache.tools.ant.taskdefs.Echo" level="WARN"/>
+ </Loggers>
+</Configuration>
+
XmlLogger
@@ -605,7 +640,7 @@ developers.
messageLogged() method
;
+ A listener or logger should not write to standard output or error in the messageLogged()
method;
Ant captures these internally and it will trigger an infinite loop.
BuildListener.buildStarted(BuildEvent event)
is called,
- the project is not fully functional. The build has started, yes, and the event.getProject() method call
+ the project is not fully functional. The build has started, yes, and the event.getProject()
method call
returns the Project instance, but that project is initialized with JVM and ant properties, nor has it
parsed the build file yet. You cannot call Project.getProperty()
for property lookup, or
Project.getName()
to get the project name (it will return null).