diff --git a/CoTreceiver/src/main/java/edu/nps/moves/cot/net/CoTMsgReceiverDemo.java b/CoTreceiver/src/main/java/edu/nps/moves/cot/net/CoTMsgReceiverDemo.java index dc8eb0833af00cb6aef7e953119d284741ed1457..0c55936f9b6a0f1987d35d194e47d61fc9202df2 100644 --- a/CoTreceiver/src/main/java/edu/nps/moves/cot/net/CoTMsgReceiverDemo.java +++ b/CoTreceiver/src/main/java/edu/nps/moves/cot/net/CoTMsgReceiverDemo.java @@ -44,6 +44,7 @@ import java.util.concurrent.TimeUnit; import mil.army.usareur.g3.mcsd.CoTUtils.*; import mil.army.usareur.g3.mcsd.CoTExample.CustomCoTparser; + import org.apache.logging.log4j.Logger; /** CoT message receiver (UPD, TCP) demonstration. This will start a CoT PLI diff --git a/CoTreceiver/src/main/resources/log4j2.xml b/CoTreceiver/src/main/resources/log4j2.xml index 3d25444bf2a670715c5ae8dd3732e9a8e624d18d..0c4ea3761825a8319479bc2b531816c8d7371b4a 100644 --- a/CoTreceiver/src/main/resources/log4j2.xml +++ b/CoTreceiver/src/main/resources/log4j2.xml @@ -1,36 +1,40 @@ <?xml version="1.0" encoding="UTF-8"?> -<Configuration status="WARN"> +<Configuration xmlns="https://logging.apache.org/xml/ns" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation=" + https://logging.apache.org/xml/ns + https://logging.apache.org/xml/ns/log4j-config-2.xsd"> <Properties> - <Property name="CONSOLE_PATTERN">%highlight{%-5level}{FATAL=bg_red, ERROR=red, WARN=yellow, INFO=green} %style{%d{yyyy MMM dd HH:mm:ss 'GMT'Z}}{blue} [%t] %C:%L - %m%n</Property> - <Property name="LOG_PATTERN">[%-5level] %d{yyyy MMM dd HH:mm:ss 'GMT'Z} [%t] %C:%L - %m%n</Property> + <Property name="LOG_PATTERN" value="[%-5level] %d{yyyy MMM dd HH:mm:ss 'GMT'Z} [%t] %C:%L - %m%n"/> + <Property name="CONSOLE_PATTERN" value="%highlight{%-5level}{FATAL=bg_red, ERROR=red, WARN=yellow, INFO=green} %style{%d{yyyy MMM dd HH:mm:ss 'GMT'Z}}{blue} [%t] %C:%L - %m%n"/> </Properties> <Appenders> <Console name="Console" target="SYSTEM_OUT"> <PatternLayout pattern="${CONSOLE_PATTERN}"/> </Console> - <RollingFile name="RollingLogFile" fileName="logs/error.log.0" filePattern="logs/error.log.%i" > + <RollingFile name="RollingLogFile" fileName="logs/error.0.log" filePattern="logs/error.%i.log" > <LevelRangeFilter minLevel="FATAL" maxLevel="ERROR" onMatch="ACCEPT" onMismatch="DENY"/> - <PatternLayout pattern="${LOG_PATTERN}"/> + <PatternLayout pattern="${LOG_PATTERN}"/> <Policies> <OnStartupTriggeringPolicy/> </Policies> - <DefaultRolloverStrategy max="20"/> + <!--<DefaultRolloverStrategy max="20" fileIndex="min"/>--> </RollingFile> - <RollingFile name="InfoLog" fileName="logs/cot.log.0" filePattern="logs/cot.log.%i"> + <RollingFile name="InfoLog" fileName="logs/cot.0.log" filePattern="logs/cot.%i.log"> <LevelRangeFilter minLevel="WARN" maxLevel="INFO" onMatch="ACCEPT" onMismatch="DENY"/> <PatternLayout pattern="${LOG_PATTERN}"/> <Policies> <OnStartupTriggeringPolicy/> </Policies> - <DefaultRolloverStrategy max="20" fileIndex="min"/> + <!--<DefaultRolloverStrategy max="20" fileIndex="min"/>--> </RollingFile> - <RollingFile name="DebugLog" fileName="logs/debug.log.0" filePattern="logs/debug.log.%i"> + <RollingFile name="DebugLog" fileName="logs/debug.0.log" filePattern="logs/debug.%i.log"> <LevelRangeFilter minLevel="DEBUG" maxLevel="DEBUG" onMatch="ACCEPT" onMismatch="DENY"/> <PatternLayout pattern="${LOG_PATTERN}"/> <Policies> <OnStartupTriggeringPolicy/> </Policies> - <DefaultRolloverStrategy max="10"/> + <!--<DefaultRolloverStrategy max="10"/>--> </RollingFile> </Appenders> <Loggers>