aboutsummaryrefslogtreecommitdiffstats
path: root/resources
diff options
context:
space:
mode:
authorShwetank Dave <shwetank.dave@amdocs.com>2018-06-11 10:15:34 -0400
committerShwetank Dave <shwetank.dave@amdocs.com>2018-07-26 09:13:18 -0400
commite16bda37d76e63e0f903bba13ed1dccf3b17f395 (patch)
tree1b8036103cf598bc645e3d4da1b6340d9c164447 /resources
parent36b5671af2c3eec5ca81663382c4ca2898f79e55 (diff)
Add logging and tests and build using mvn
An initial version of adding logs to chameleon An initial version of adding specs (tests) to chameleon. Adding pom.xml so the project can be build using maven. Updating README.md for instructions on running it locally. Issue-ID: AAI-1220 Change-Id: I85f46fd7f625c83b84f211d6766970431e6d91eb Signed-off-by: Shwetank Dave <shwetank.dave@amdocs.com>
Diffstat (limited to 'resources')
-rw-r--r--resources/chameleon_logback.xml109
-rw-r--r--resources/log/ChameleonMsgs.properties19
2 files changed, 128 insertions, 0 deletions
diff --git a/resources/chameleon_logback.xml b/resources/chameleon_logback.xml
new file mode 100644
index 0000000..5b723d7
--- /dev/null
+++ b/resources/chameleon_logback.xml
@@ -0,0 +1,109 @@
+<configuration scan="true" scanPeriod="3 seconds" debug="false">
+ <!--<jmxConfigurator /> -->
+ <!-- directory path for all other type logs -->
+
+ <property name="logDir" value="/opt/chameleon/logs" />
+
+ <!-- specify the component name -->
+ <property name="componentName" value="AAI-CHAMELEON" />
+
+ <!-- default eelf log file names -->
+ <property name="generalLogName" value="error" />
+ <property name="metricsLogName" value="metrics" />
+ <property name="auditLogName" value="audit" />
+ <property name="debugLogName" value="debug" />
+
+ <property name="errorLogPattern" value="%d{yyyy-MM-dd'T'HH:mm:ss.SSSXXX}|%mdc{RequestId}|%thread|DataRouter|%mdc{PartnerName}|%logger||%.-5level|%msg%n" />
+
+ <property name="auditMetricPattern" value="%msg%n" />
+
+ <property name="logDirectory" value="${logDir}/${componentName}" />
+
+ <!-- ============================================================================ -->
+ <!-- EELF Appenders -->
+ <!-- ============================================================================ -->
+
+ <!-- The EELFAppender is used to record events to the general application
+ log -->
+
+ <appender name="EELF"
+ class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>${logDirectory}/${generalLogName}.log</file>
+ <rollingPolicy
+ class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+ <fileNamePattern>${logDirectory}/${generalLogName}.%d{yyyy-MM-dd}.log.zip
+ </fileNamePattern>
+ <maxHistory>60</maxHistory>
+ </rollingPolicy>
+ <encoder>
+ <pattern>${errorLogPattern}</pattern>
+ <outputPatternAsHeader>true</outputPatternAsHeader>
+ </encoder>
+ </appender>
+
+ <appender name="asyncEELF" class="ch.qos.logback.classic.AsyncAppender">
+ <!-- deny all events with a level below INFO, that is TRACE and DEBUG -->
+ <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+ <level>INFO</level>
+ </filter>
+ <queueSize>256</queueSize>
+ <appender-ref ref="EELF" />
+ </appender>
+
+
+ <!-- EELF Audit Appender. This appender is used to record audit engine
+ related logging events. The audit logger and appender are specializations
+ of the EELF application root logger and appender. This can be used to segregate
+ Policy engine events from other components, or it can be eliminated to record
+ these events as part of the application root log. -->
+
+ <appender name="EELFAudit"
+ class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>${logDirectory}/${auditLogName}.log</file>
+ <rollingPolicy
+ class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+ <fileNamePattern>${logDirectory}/${auditLogName}.%d{yyyy-MM-dd}.log.zip
+ </fileNamePattern>
+ <maxHistory>60</maxHistory>
+ </rollingPolicy>
+ <encoder>
+ <outputPatternAsHeader>true</outputPatternAsHeader>
+ <pattern>${auditMetricPattern}</pattern>
+ </encoder>
+ </appender>
+
+ <appender name="asyncEELFAudit" class="ch.qos.logback.classic.AsyncAppender">
+ <queueSize>256</queueSize>
+ <appender-ref ref="EELFAudit" />
+ </appender>
+ <!-- ============================================================================ -->
+ <!-- EELF loggers -->
+ <!-- ============================================================================ -->
+
+ <!-- CRUD Service loggers -->
+ <logger name="chameleon" level="INFO">
+ <appender-ref ref="asyncEELF" />
+ </logger>
+
+ <logger name="com.att.eelf.audit" level="info" additivity="false">
+ <appender-ref ref="asyncEELFAudit" />
+ </logger>
+
+ <!-- Other Loggers that may help troubleshoot -->
+ <logger name="net.sf" level="WARN" />
+ <logger name="org.apache" level="WARN" />
+ <logger name="org.apache.commons.httpclient" level="WARN" />
+ <logger name="org.apache.commons" level="WARN" />
+ <logger name="org.apache.coyote" level="WARN" />
+ <logger name="org.apache.jasper" level="WARN" />
+
+ <!-- logback internals logging -->
+ <logger name="ch.qos.logback.classic" level="WARN" />
+ <logger name="ch.qos.logback.core" level="WARN" />
+
+ <root>
+ <!-- <appender-ref ref="asyncEELF" /> -->
+ <!-- <appender-ref ref="asyncEELFDebug" /> -->
+ </root>
+
+</configuration>
diff --git a/resources/log/ChameleonMsgs.properties b/resources/log/ChameleonMsgs.properties
new file mode 100644
index 0000000..4e61e2a
--- /dev/null
+++ b/resources/log/ChameleonMsgs.properties
@@ -0,0 +1,19 @@
+EVENT_PROCESSOR=\
+CHM0001I|\
+Event Processor {0}\
+
+GALLIFREY_ASSERTION=\
+CHM0002I|\
+Attempt Gallifrey Assertion of operation {0} with type {1} and key {2} \
+
+GALLIFREY_ASSERTED=\
+CHM0002I|\
+Asserted type {0} and key {1} in Gallifrey\
+
+RESPONSE=\
+CHM0003I|\
+Response for operation "{0}" for endpoint "{1}" resulted in status "{2}" with body "{3}"\
+
+CHAMELEON_REQUEST=\
+CHM0004I|\
+Incoming Request of type "{0}" for endpoint "{1}" from address "{2}"\ \ No newline at end of file