I'm having trouble getting my log4j2.xml file to conform to the schema.
Without the schema specification I don't have any errors but with it in
place I am getting:

cvc-complex-type.2.4.d: Invalid content was found starting with element
'File'. No child element is expected at 

 this point.

 

cvc-complex-type.2.4.d: Invalid content was found starting with element
'Logger'. No child element is expected 

 at this point.

 

The logging works fine without the schema but Eclipse is warning that its
missing so I would like to have it in place. This is the log4j2.xml file I'm
using:

<?xml version="1.0" encoding="UTF-8"?>
 
<Configuration strict="true"
           xmlns="http://logging.apache.org/log4j/2.0/config";
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
           xsi:schemaLocation="http://logging.apache.org/log4j/2.0/config 
 
https://raw.githubusercontent.com/apache/logging-log4j2/log4j-2.11.1/log4j-c
ore/src/main/resources/Log4j-config.xsd">
 
  <Appenders>
 
    <Console name="console" target="SYSTEM_OUT">
      <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss z} %-5p %-5level -
%msg%n"/>
    </Console>
 
    <File name="file" fileName="mylogfile.log" append="true">
      <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss z} %-5p %-5level -
%msg%n"/>
    </File >
  </Appenders>
 
 
  <Loggers>
    <Root level="DEBUG">
      <AppenderRef ref="console"/>
      <AppenderRef ref="file"/>
    </Root>
 
    <Logger name="org.apache.http" level="WARN" additivity="false">
      <AppenderRef ref="console"/>
      <AppenderRef ref="file"/>
    </Logger>
 
    <Logger name="net.authorize.util" level="WARN" additivity="false">
      <AppenderRef ref="console"/>
      <AppenderRef ref="file"/>
    </Logger>
 
    <Logger name="net.authorize.api" level="WARN" additivity="false">
      <AppenderRef ref="console"/>
      <AppenderRef ref="file"/>
    </Logger>
 
  </Loggers>
 
</Configuration>

 

 

Any help would be appreciated.

 

 

Thank you

 

.ed

 

 

Reply via email to