Hi, all,
I have the following logback.xml file, I developed a servlet, and used
common logging library,
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
Log logger = LogFactory.getLog(FileTestServlet.class);
I also added this to the logback.xml:
<logger name="next.filetest" level="debug"/>
In the code, I have the following code:
logger.debug("FileTestServlet doGet...");
But in the xwiki.log file, the message is not logged to the log file,
anything wrong? I tried to configure log4j.properties in the classes
folder, used log4j logger for logging, there is no message logged either.
Thanks for your help.
Dave
<configuration>
<appender name="xwiki"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<!--See also
http://logback.qos.ch/manual/appenders.html#RollingFileAppender-->
<file>C:\apache-tomcat-7.0.25\logs\xwiki.log</file>
<append>false</append>
<encoder>
<pattern>%d [%t] %-5p %c - %m%n</pattern>
</encoder>
<rollingPolicy
class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<maxIndex>10</maxIndex>
<FileNamePattern>C:\apache-tomcat-7.0.25\logs\xwiki.log.%i</FileNamePattern>
</rollingPolicy>
<triggeringPolicy
class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<MaxFileSize>5MB</MaxFileSize>
</triggeringPolicy>
</appender>
<logger name="com.xpn.xwiki.render.XWikiRadeoxRenderEngine"
level="warn"/>
<logger name="org.apache.fop.layoutmgr.inline.ContentLayoutManager"
level="error"/>
<logger name="org.apache.struts.util.RequestUtils"
level="error"/>
<logger name="org.hibernate.type" level="warn"/>
<logger name="com.xpn.xwiki.store.migration" level="info"/>
<logger name="org.hibernate.SQL" level="debug"/>
<logger name="org.jgroups" level="error"/>
<logger name="org.hibernate" level="warn"/>
<logger name="info.informatica.doc.style.css.dom"
level="error"/>
<logger name="org.hibernate.ps.PreparedStatementCache"
level="warn"/>
<logger name="org.xwiki" level="info"/>
<logger name="com.xpn.xwiki" level="warn"/>
<logger name="next.filetest" level="debug"/>
<root level="DEBUG">
<appender-ref ref="xwiki"/>
</root>
</configuration>