Log4j Logging не работает, т.е. файл журнала генерирует неоднозначность - PullRequest
0 голосов
/ 22 января 2020

Я использовал Log4j в моем проекте; Я импортировал log4j.1.2.16.jar в моем проекте. Теперь, когда я использую свой журнал с logger.info, он показывает вывод, как показано ниже в моем файле журнала ...

Я просто написал LogManager java, чтобы получить root регистратор и сделал экземпляр в моем классе, чтобы создать объект регистратора и использовать в моем коде ..

Пожалуйста, помогите:

Вывод:


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

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...