Log4j日志记录不起作用,即日志文件产生歧义

时间:2020-01-22 09:56:43

标签: java log4j

我在项目中使用过Log4j;我已经在项目中导入了log4j.1.2.16.jar。现在,当我在logger.info中使用日志时,它在日志文件中显示如下输出...

我只是编写了一个LogManager Java来获取根记录器,并在我的类中创建了一个实例来创建记录器对象并在我的代码中使用了。.

请帮助:

输出:


In AxisServletBase init
Enter: getEngine()
getBundle(org.apache.axis,org.apache.axis.i18n,resource,null,...)
loadBundle: Ignoring MissingResourceException: Can't find bundle for base name org.apache.axis.resource, locale en_US
Created org.apache.axis.i18n.resource, linked to parent null
getBundle(org.apache.axis,org.apache.axis.utils,resource,null,...)
loadBundle: Ignoring MissingResourceException: Can't find bundle for base name org.apache.axis.utils.resource, locale en_US
loadBundle: Ignoring MissingResourceException: Can't find bundle for base name org.apache.axis.resource, locale en_US
Root package not found, cross link to org.apache.axis.i18n.resource
Root package not found, cross link to org.apache.axis.i18n.resource
org.apache.axis.i18n.resource::handleGetObject(engineFactory)
Got EngineFactory: org.apache.axis.configuration.EngineConfigurationFactoryServlet
Enter: DefaultAxisServerFactory::getServer
Enter: DefaultAxisServerFactory::getEngineConfiguration
Exit: DefaultAxisServerFactory::getEngineConfiguration
Enter: AxisEngine::init
org.apache.axis.i18n.resource::handleGetObject(attachEnabled)
Attachment support is enabled?  true
Enter/Exit: JAFDataHandlerDeserializerFactory(class java.lang.String, {http://xml.apache.org/xml-soap}PlainText)
org.apache.axis.i18n.resource::handleGetObject(oddDigits00)
org.apache.axis.i18n.resource::handleGetObject(badChars01)
Enter/Exit: JAFDataHandlerDeserializerFactory(class java.awt.Image, {http://xml.apache.org/xml-soap}Image)
Enter/Exit: JAFDataHandlerDeserializerFactory(class javax.mail.internet.MimeMultipart, {http://xml.apache.org/xml-soap}Multipart)
Enter/Exit: JAFDataHandlerDeserializerFactory(interface javax.xml.transform.Source, {http://xml.apache.org/xml-soap}Source)
Enter/Exit: JAFDataHandlerDeserializerFactory(class org.apache.axis.attachments.OctetStream, {http://xml.apache.org/xml-soap}octet-stream)
Enter/Exit: JAFDataHandlerDeserializerFactory()
@69dd5606 added parameter >name:       {http://webservice.fms.com}fileName
typeEntry:  null
mode:       IN
position:   0
isReturn:   false
typeQName:  {http://www.w3.org/2001/XMLSchema}string
javaType:   null
inHeader:   false
outHeader:  false
@6f51db76<total parameters:1
@1db055ccsetReturnType({http://www.w3.org/2001/XMLSchema}boolean)
@1db055cc added parameter >name:       {http://webservice.fms.com}str
typeEntry:  null
mode:       IN
position:   0
isReturn:   false
typeQName:  {http://www.w3.org/2001/XMLSchema}string
javaType:   null
inHeader:   false
outHeader:  false
@395fc70c<total parameters:1
@3ab1db47setReturnType({http://www.w3.org/2001/XMLSchema}string)
@3ab1db47 added parameter >name:       {http://webservice.fms.com}userId
typeEntry:  null
mode:       IN
position:   0
isReturn:   false
typeQName:  {http://www.w3.org/2001/XMLSchema}string
javaType:   null
inHeader:   false
outHeader:  false
@5b5a3d0c<total parameters:1
@3ab1db47 added parameter >name:       {http://webservice.fms.com}key
typeEntry:  null
mode:       IN
position:   1
isReturn:   false
typeQName:  {http://www.w3.org/2001/XMLSchema}string
javaType:   null
inHeader:   false
outHeader:  false
@44db1d9e<total parameters:2
@3ab1db47 added parameter >name:       {http://webservice.fms.com}authCode
typeEntry:  null
mode:       IN
position:   2
isReturn:   false
typeQName:  {http://www.w3.org/2001/XMLSchema}string
javaType:   null
inHeader:   false
outHeader:  false
@3fbc5ae<total parameters:3
@3ab1db47 added parameter >name:       {http://webservice.fms.com}bankCode
typeEntry:  null
mode:       IN
position:   3
isReturn:   false
typeQName:  {http://www.w3.org/2001/XMLSchema}string
javaType:   null
inHeader:   false
outHeader:  false
@37245d75<total parameters:4
@3ab1db47 added parameter >name:       {http://webservice.fms.com}accountNo
typeEntry:  null
mode:       IN
position:   4
isReturn:   false
typeQName:  {http://www.w3.org/2001/XMLSchema}string
javaType:   null
inHeader:   false
outHeader:  false
@3d1cb4c0<total parameters:5
Exit: AxisEngine::init
Exit: DefaultAxisServerFactory::getServer
Exit: getEngine()
Using org.apache.cxf.common.logging.Log4jLogger for logging.
In AxisServletBase init
Enter: getEngine()
getBundle(org.apache.axis,org.apache.axis.i18n,resource,null,...)
loadBundle: Ignoring MissingResourceException: Can't find bundle for base name org.apache.axis.resource, locale en_US
Created org.apache.axis.i18n.resource, linked to parent null
getBundle(org.apache.axis,org.apache.axis.utils,resource,null,...)
loadBundle: Ignoring MissingResourceException: Can't find bundle for base name org.apache.axis.utils.resource, locale en_US
loadBundle: Ignoring MissingResourceException: Can't find bundle for base name org.apache.axis.resource, locale en_US
Root package not found, cross link to org.apache.axis.i18n.resource
Root package not found, cross link to org.apache.axis.i18n.resource
org.apache.axis.i18n.resource::handleGetObject(engineFactory)
Got EngineFactory: org.apache.axis.configuration.EngineConfigurationFactoryServlet
Enter: DefaultAxisServerFactory::getServer
Enter: DefaultAxisServerFactory::getEngineConfiguration
Exit: DefaultAxisServerFactory::getEngineConfiguration
Enter: AxisEngine::init
org.apache.axis.i18n.resource::handleGetObject(attachEnabled)
Attachment support is enabled?  true
Enter/Exit: JAFDataHandlerDeserializerFactory(class java.lang.String, {http://xml.apache.org/xml-soap}PlainText)
org.apache.axis.i18n.resource::handleGetObject(oddDigits00)
org.apache.axis.i18n.resource::handleGetObject(badChars01)
Enter/Exit: JAFDataHandlerDeserializerFactory(class java.awt.Image, {http://xml.apache.org/xml-soap}Image)
Enter/Exit: JAFDataHandlerDeserializerFactory(class javax.mail.internet.MimeMultipart, {http://xml.apache.org/xml-soap}Multipart)
Enter/Exit: JAFDataHandlerDeserializerFactory(interface javax.xml.transform.Source, {http://xml.apache.org/xml-soap}Source)
Enter/Exit: JAFDataHandlerDeserializerFactory(class org.apache.axis.attachments.OctetStream, {http://xml.apache.org/xml-soap}octet-stream)
Enter/Exit: JAFDataHandlerDeserializerFactory()
@5dd70711 added parameter >name:       {http://webservice.fms.com}fileName
typeEntry:  null
mode:       IN
position:   0
isReturn:   false
typeQName:  {http://www.w3.org/2001/XMLSchema}string
javaType:   null
inHeader:   false
outHeader:  false
@6a901b32<total parameters:1
@3cfab8d4setReturnType({http://www.w3.org/2001/XMLSchema}boolean)
@3cfab8d4 added parameter >name:       {http://webservice.fms.com}str
typeEntry:  null
mode:       IN
position:   0
isReturn:   false
typeQName:  {http://www.w3.org/2001/XMLSchema}string
javaType:   null
inHeader:   false
outHeader:  false
@71651719<total parameters:1
@146f69absetReturnType({http://www.w3.org/2001/XMLSchema}string)
@146f69ab added parameter >name:       {http://webservice.fms.com}userId
typeEntry:  null
mode:       IN
position:   0
isReturn:   false
typeQName:  {http://www.w3.org/2001/XMLSchema}string
javaType:   null
inHeader:   false
outHeader:  false
@7ecca99f<total parameters:1
@146f69ab added parameter >name:       {http://webservice.fms.com}key
typeEntry:  null
mode:       IN
position:   1
isReturn:   false
typeQName:  {http://www.w3.org/2001/XMLSchema}string
javaType:   null
inHeader:   false
outHeader:  false
@1719928a<total parameters:2
@146f69ab added parameter >name:       {http://webservice.fms.com}authCode
typeEntry:  null
mode:       IN
position:   2
isReturn:   false
typeQName:  {http://www.w3.org/2001/XMLSchema}string
javaType:   null
inHeader:   false
outHeader:  false
@4e1d92af<total parameters:3
@146f69ab added parameter >name:       {http://webservice.fms.com}bankCode
typeEntry:  null
mode:       IN
position:   3
isReturn:   false
typeQName:  {http://www.w3.org/2001/XMLSchema}string
javaType:   null
inHeader:   false
outHeader:  false
@215098f6<total parameters:4
@146f69ab added parameter >name:       {http://webservice.fms.com}accountNo
typeEntry:  null
mode:       IN
position:   4
isReturn:   false
typeQName:  {http://www.w3.org/2001/XMLSchema}string
javaType:   null
inHeader:   false
outHeader:  false
@3a4b5d12<total parameters:5
Exit: AxisEngine::init
Exit: DefaultAxisServerFactory::getServer
Exit: getEngine()
Using org.apache.cxf.common.logging.Log4jLogger for logging.


Log4j.properties


# Root logger option
log4j.rootLogger=DEBUG, file, stdout

log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.Threshold=DEBUG
log4j.appender.file.File=D://FMS//WebServiceLog.txt
log4j.appender.file.MaxFileSize=2MB
log4j.appender.file.MaxBackupIndex=5
log4j.appender.file.RollingPolicy.ScavengeInterva=30000
log4j.appender.file.BufferedIO=false
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%m%n

# Direct log messages to stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%m%n
#%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n

0 个答案:

没有答案