最近发现应用系统运行时,总是有“exception: org.xml.sax.SAXParseException: Content is not allowed in prolog”错误信息,分析错误后,定位components.loggers.xml配置文件有问题,<entry key="app"> <bean class="com.cvicse.commons.log.config.Log4jConfig"> <property name="configFile"> <value>log4j.properties</value> </property> <property name="logName"> <value>app</value> </property> </bean> </entry>将上面代码中的log4j.properties修改为:log4j.xml文件后,提示 log4j:ERROR The content of element type "log4j:configuration" must match "的错误信息,从百度上搜索可能原因是log4j.xml中文件的位置不对应,发现应用系统中缺少log4j.xml、log4j.properties和log4j.dtd三个配置文件,添加配置文件并部署后,问题解决。Log4j 的详细介绍:请点这里 Log4j 的下载地址:请点这里相关阅读:Log4j入门使用教程 http://www.linuxidc.com/Linux/2013-06/85223.htmHibernate配置Log4j显示SQL参数 http://www.linuxidc.com/Linux/2013-03/81870.htmLog4j学习笔记(1)_Log4j 基础&配置项解析 http://www.linuxidc.com/Linux/2013-03/80586.htmLog4j学习笔记(2)_Log4j配置示例&Spring集成Log4j http://www.linuxidc.com/Linux/2013-03/80587.htm