Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions create_server_dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ cp ${INSTALL_DIR}/clean_es_history.sh ${CONFIG_TEMPLATES
# ==============================================
TOMCAT_LIB_DIR=${CWS_TOMCAT_ROOT}/lib
TOMCAT_BIN_DIR=${CWS_TOMCAT_ROOT}/bin
TOMCAT_CONF_DIR=${CWS_TOMCAT_ROOT}/conf

print 'Installing key and trust store to Tomcat...'
cp ${INSTALL_DIR}/.keystore ${CWS_TOMCAT_ROOT}/conf/.keystore
Expand All @@ -116,11 +117,10 @@ print 'Installing core libraries to Tomcat...'
cp ${ROOT}/cws-core/target/cws-core.jar ${TOMCAT_LIB_DIR}

rm -f ${TOMCAT_LIB_DIR}/slf4j*.jar
cp ${ROOT}/cws-core/cws-core-libs/slf4j-log4j12-*.jar ${TOMCAT_LIB_DIR}
cp ${ROOT}/cws-core/cws-core-libs/slf4j-api-*.jar ${TOMCAT_LIB_DIR}
cp ${ROOT}/cws-core/cws-core-libs/log4j-slf4j-impl*.jar ${TOMCAT_LIB_DIR}

cp ${ROOT}/cws-core/cws-core-libs/log4j-*.jar ${TOMCAT_LIB_DIR}
cp ${ROOT}/cws-core/cws-core-libs/apache-log4j-extras-*.jar ${TOMCAT_LIB_DIR}
cp ${ROOT}/cws-core/cws-core-libs/jython*.jar ${TOMCAT_LIB_DIR}

print 'Installing cws-tasks libraries to Tomcat...'
Expand Down Expand Up @@ -188,14 +188,24 @@ cp ${INSTALL_DIR}/sql/core.afterstartup.sql.template ${CWS}/sql/cws/co
rm ${DIST}/snippets.java
rm ${DIST}/snippets.java.bak

print 'Installing log4j Properties file to Tomcat...'
cp ${INSTALL_DIR}/tomcat_lib/log4j.properties ${TOMCAT_LIB_DIR}
print 'Setting up Log4J as the logging backend for Tomcat...'
LOG4J2_LIB=${CWS_TOMCAT_ROOT}/log4j2/lib
LOG4J2_CONF=${CWS_TOMCAT_ROOT}/log4j2/conf
mkdir -p ${LOG4J2_LIB}
mkdir -p ${LOG4J2_CONF}
cp ${ROOT}/cws-core/cws-core-libs/log4j-api-*.jar ${LOG4J2_LIB}
cp ${ROOT}/cws-core/cws-core-libs/log4j-core-*.jar ${LOG4J2_LIB}
cp ${ROOT}/cws-core/cws-core-libs/log4j-appserver-*.jar ${LOG4J2_LIB}
cp ${INSTALL_DIR}/tomcat_lib/log4j2-tomcat.properties ${LOG4J2_CONF}

print 'Removing default logging.properties from Tomcat...'
rm ${TOMCAT_CONF_DIR}/logging.properties

print 'Copying Installer scripts and libraries...'
cp ${ROOT}/utils.sh ${CWS}
cp ${ROOT}/cws-installer/cws-installer-libs/* ${CWS}/installer
cp ${ROOT}/cws-installer/target/cws-installer.jar ${CWS}/installer
cp ${ROOT}/cws-installer/src/main/resources/log4j.properties ${CWS}/installer
cp ${ROOT}/cws-installer/src/main/resources/log4j2.properties ${CWS}/installer

cp ${INSTALL_DIR}/configure.sh ${CWS}
cp ${INSTALL_DIR}/installerPresets.properties ${CWS}/config
Expand Down
13 changes: 3 additions & 10 deletions cws-adaptation-engine/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,10 @@
</exclusions>
</dependency>

<!-- LOGGING: [Spring/JCL to log4j], [CWS/slf4j to log4j] -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<scope>provided</scope>
</dependency>

<!-- https://mvnrepository.com/artifact/log4j/apache-log4j-extras -->
<dependency>
<groupId>log4j</groupId>
<artifactId>apache-log4j-extras</artifactId>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
Expand Down
14 changes: 4 additions & 10 deletions cws-adaptation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,11 @@
<groupId>gov.nasa.jpl.ammos.ids.cws</groupId>
<artifactId>cws-service</artifactId>
</dependency>

<!-- LOGGING: [Spring/JCL to log4j], [CWS/slf4j to log4j] -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/log4j/apache-log4j-extras -->

<dependency>
<groupId>log4j</groupId>
<artifactId>apache-log4j-extras</artifactId>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
Expand Down
19 changes: 9 additions & 10 deletions cws-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,17 @@
</properties>

<dependencies>

<!-- LOGGING: [Spring/JCL to log4j], [CWS/slf4j to log4j] -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>

<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/log4j/apache-log4j-extras -->
</dependency>

<!-- log4j-appserver jar for Tomcat to use log4j2 -->
<dependency>
<groupId>log4j</groupId>
<artifactId>apache-log4j-extras</artifactId>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-appserver</artifactId>
</dependency>

<dependency>
Expand Down
15 changes: 4 additions & 11 deletions cws-engine-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,11 @@
</exclusion>
</exclusions>
</dependency>

<!-- LOGGING: [Spring/JCL to log4j], [CWS/slf4j to log4j] -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<scope>provided</scope>
</dependency>

<!-- https://mvnrepository.com/artifact/log4j/apache-log4j-extras -->

<dependency>
<groupId>log4j</groupId>
<artifactId>apache-log4j-extras</artifactId>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
Expand Down
13 changes: 3 additions & 10 deletions cws-installer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,10 @@

<dependencies>

<!-- LOGGING: [Spring/JCL to log4j], [CWS/slf4j to log4j] -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<scope>provided</scope>
</dependency>

<!-- https://mvnrepository.com/artifact/log4j/apache-log4j-extras -->
<dependency>
<groupId>log4j</groupId>
<artifactId>apache-log4j-extras</artifactId>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<scope>provided</scope>
</dependency>

<!-- Apache Commons -->
Expand Down
11 changes: 0 additions & 11 deletions cws-installer/src/main/resources/log4j.properties

This file was deleted.

46 changes: 46 additions & 0 deletions cws-installer/src/main/resources/log4j2.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#log4j.rootLogger=INFO, CA
#
## ConsoleAppender
#log4j.appender.CA=org.apache.log4j.ConsoleAppender
#log4j.appender.CA.layout=org.apache.log4j.EnhancedPatternLayout
#log4j.appender.CA.layout.ConversionPattern=INSTALLER: %d{ISO8601}{UTC} %-5p [%20.20t] %30.30c(%4.4L) - %m%n
#log4j.logger.org.springframework=INFO
#log4j.logger.jpl.cws=INFO
#log4j.logger.javax.activation.level=INFO
#
#log4j.logger.org.apache.activemq.transport=INFO
#

# 'status' refers to log messages from Log4j2 itself
status = warn

# console appender
appender.console.type = Console
appender.console.name = STDOUT
appender.console.layout.type = PatternLayout
appender.console.layout.pattern = INSTALLER: %d{ISO8601}{UTC} %-5p [%20.20t] %30.30c(%4.4L) - %m%n

# configure loggers
# Spring Framework
logger.springframework.name = org.springframework
logger.springframework.level = info
logger.springframework.appenderRef.stdout.ref = STDOUT

# CWS
logger.cws.name = jpl.cws
logger.cws.level = info
logger.cws.appenderRef.stdout.ref = STDOUT

# Javax
logger.javax.name = javax.activation.level
logger.javax.level = info
logger.javax.appenderRef.stdout.ref = STDOUT

# ActiveMQ
logger.activemq.name = org.apache.activemq.transport
logger.activemq.level = info
logger.activemq.appenderRef.stdout.ref = STDOUT

# ROOT
rootLogger.level = info
rootLogger.appenderRef.stdout.ref = STDOUT
11 changes: 2 additions & 9 deletions cws-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,19 +91,12 @@
<artifactId>joda-time</artifactId>
</dependency>

<!-- LOGGING: [Spring/JCL to log4j], [CWS/slf4j to log4j] -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<scope>provided</scope>
</dependency>

<!-- https://mvnrepository.com/artifact/log4j/apache-log4j-extras -->
<dependency>
<groupId>log4j</groupId>
<artifactId>apache-log4j-extras</artifactId>
</dependency>

<!-- Freemarker -->
<dependency>
<groupId>org.freemarker</groupId>
Expand Down
13 changes: 6 additions & 7 deletions cws-tasks/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,17 @@
</exclusions>
</dependency>

<!-- LOGGING: [Spring/JCL to log4j], [CWS/slf4j to log4j] -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<scope>provided</scope>
</dependency>

<!-- https://mvnrepository.com/artifact/log4j/apache-log4j-extras -->
<dependency>
<groupId>log4j</groupId>
<artifactId>apache-log4j-extras</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>log4j</groupId>-->
<!-- <artifactId>apache-log4j-extras</artifactId>-->
<!-- </dependency>-->

<!-- USE THIS LIB, ONCE EVERYONE IS ON JAVA 7 -->
<!-- <dependency> <groupId>io.fastjson</groupId> <artifactId>boon</artifactId>
Expand Down
13 changes: 3 additions & 10 deletions cws-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,12 @@
</properties>

<dependencies>

<!-- LOGGING: [Spring/JCL to log4j], [CWS/slf4j to log4j] -->

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<scope>provided</scope>
</dependency>

<!-- https://mvnrepository.com/artifact/log4j/apache-log4j-extras -->
<dependency>
<groupId>log4j</groupId>
<artifactId>apache-log4j-extras</artifactId>
</dependency>

<dependency>
<groupId>gov.nasa.jpl.ammos.ids.cws</groupId>
Expand Down
2 changes: 1 addition & 1 deletion dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ print "Done configuring console installation."
# --------------
# START CONSOLE
# --------------
LOG_FILE="server/apache-tomcat-${TOMCAT_VER}/logs/catalina.out"
LOG_FILE="server/apache-tomcat-${TOMCAT_VER}/logs/cws.log"
BASE_PORT=8000

tab ${DIST}/console-only/cws "./start_cws.sh -d $BASE_PORT; tail -f $LOG_FILE"
Expand Down
18 changes: 13 additions & 5 deletions install/docker/console-db-es-ls-kibana/cws-logstash.conf
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
input {
file {
path => "/cws_logs/catalina.out"
path => "/cws_logs/cws.log"
codec => multiline {
pattern => "(^%{MONTH} %{MONTHDAY}, 20%{YEAR} %{HOUR}:?%{MINUTE}(?::?%{SECOND}) (?:AM|PM))|(^%{DATA}\s?: %{TIMESTAMP_ISO8601})|(^%{MONTHDAY}-%{MONTH}-%{YEAR} %{TIME})"
pattern => "(^%{MONTH} %{MONTHDAY}, 20%{YEAR} %{HOUR}:?%{MINUTE}(?::?%{SECOND}) (?:AM|PM))|(^%{TIMESTAMP_ISO8601})|(^%{MONTHDAY}-%{MONTH}-%{YEAR} %{TIME})"
negate => true
what => "previous"
}
}
file {
path => "__CWS_CATALINA_OUT_PATH__/catalina.out"
codec => multiline {
pattern => "(^%{MONTH} %{MONTHDAY}, 20%{YEAR} %{HOUR}:?%{MINUTE}(?::?%{SECOND}) (?:AM|PM))|(^%{TIMESTAMP_ISO8601})|(^%{MONTHDAY}-%{MONTH}-%{YEAR} %{TIME})"
negate => true
what => "previous"
}
}
}

filter {
Expand All @@ -16,9 +24,9 @@ filter {

grok {
match => [
"message", '%{DATA:program}\s?: %{TIMESTAMP_ISO8601:logdate} %{DATA:logLevel} +\[%{DATA:threadName}\] .* - \[%{DATA:cwsHost}\]\[%{DATA:cwsWorkerId}\]\[%{DATA:procDefKey}\]\[%{DATA:procInstId}\]\[%{DATA:actInstId}\] %{GREEDYDATA:msgBody}',
"message", '%{DATA:program}\s?: %{TIMESTAMP_ISO8601:logdate} %{DATA:logLevel} +\[%{DATA:threadName}\] .* - \[%{DATA:cwsHost}\]\[%{DATA:cwsWorkerId}\] %{GREEDYDATA:msgBody}',
"message", '%{DATA:program}\s?: %{TIMESTAMP_ISO8601:logdate} %{DATA:logLevel} +\[%{DATA:threadName}\] .* - %{GREEDYDATA:msgBody}',
"message", '%{TIMESTAMP_ISO8601:logdate} %{DATA:logLevel} +\[%{DATA:threadName}\] .* - \[%{DATA:cwsHost}\]\[%{DATA:cwsWorkerId}\]\[%{DATA:procDefKey}\]\[%{DATA:procInstId}\]\[%{DATA:actInstId}\] %{GREEDYDATA:msgBody}',
"message", '%{TIMESTAMP_ISO8601:logdate} %{DATA:logLevel} +\[%{DATA:threadName}\] .* - \[%{DATA:cwsHost}\]\[%{DATA:cwsWorkerId}\] %{GREEDYDATA:msgBody}',
"message", '%{TIMESTAMP_ISO8601:logdate} %{DATA:logLevel} +\[%{DATA:threadName}\] .* - %{GREEDYDATA:msgBody}',
"message", '^(?<logdate>%{MONTHDAY}-%{MONTH}-%{YEAR} %{TIME}) %{DATA:logLevel}\s+(\[%{DATA:threadName}\]\s+)?%{GREEDYDATA:msgBody}',
"message", '%{GREEDYDATA:msgBody}'
]
Expand Down
2 changes: 1 addition & 1 deletion install/docker/cws-image/wait_for_mariadb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ done

exec "$@"

tail -f cws/server/apache-tomcat-*/logs/catalina.out
tail -f cws/server/apache-tomcat-*/logs/cws.log
18 changes: 13 additions & 5 deletions install/docker/es-only/cws-logstash.conf
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
input {
file {
path => "/cws_logs/catalina.out"
path => "/cws_logs/cws.log"
codec => multiline {
pattern => "(^%{MONTH} %{MONTHDAY}, 20%{YEAR} %{HOUR}:?%{MINUTE}(?::?%{SECOND}) (?:AM|PM))|(^%{DATA}\s?: %{TIMESTAMP_ISO8601})|(^%{MONTHDAY}-%{MONTH}-%{YEAR} %{TIME})"
pattern => "(^%{MONTH} %{MONTHDAY}, 20%{YEAR} %{HOUR}:?%{MINUTE}(?::?%{SECOND}) (?:AM|PM))|(^%{TIMESTAMP_ISO8601})|(^%{MONTHDAY}-%{MONTH}-%{YEAR} %{TIME})"
negate => true
what => "previous"
}
}
file {
path => "__CWS_CATALINA_OUT_PATH__/catalina.out"
codec => multiline {
pattern => "(^%{MONTH} %{MONTHDAY}, 20%{YEAR} %{HOUR}:?%{MINUTE}(?::?%{SECOND}) (?:AM|PM))|(^%{TIMESTAMP_ISO8601})|(^%{MONTHDAY}-%{MONTH}-%{YEAR} %{TIME})"
negate => true
what => "previous"
}
}
}

filter {
Expand All @@ -16,9 +24,9 @@ filter {

grok {
match => [
"message", '%{DATA:program}\s?: %{TIMESTAMP_ISO8601:logdate} %{DATA:logLevel} +\[%{DATA:threadName}\] .* - \[%{DATA:cwsHost}\]\[%{DATA:cwsWorkerId}\]\[%{DATA:procDefKey}\]\[%{DATA:procInstId}\]\[%{DATA:actInstId}\] %{GREEDYDATA:msgBody}',
"message", '%{DATA:program}\s?: %{TIMESTAMP_ISO8601:logdate} %{DATA:logLevel} +\[%{DATA:threadName}\] .* - \[%{DATA:cwsHost}\]\[%{DATA:cwsWorkerId}\] %{GREEDYDATA:msgBody}',
"message", '%{DATA:program}\s?: %{TIMESTAMP_ISO8601:logdate} %{DATA:logLevel} +\[%{DATA:threadName}\] .* - %{GREEDYDATA:msgBody}',
"message", '%{TIMESTAMP_ISO8601:logdate} %{DATA:logLevel} +\[%{DATA:threadName}\] .* - \[%{DATA:cwsHost}\]\[%{DATA:cwsWorkerId}\]\[%{DATA:procDefKey}\]\[%{DATA:procInstId}\]\[%{DATA:actInstId}\] %{GREEDYDATA:msgBody}',
"message", '%{TIMESTAMP_ISO8601:logdate} %{DATA:logLevel} +\[%{DATA:threadName}\] .* - \[%{DATA:cwsHost}\]\[%{DATA:cwsWorkerId}\] %{GREEDYDATA:msgBody}',
"message", '%{TIMESTAMP_ISO8601:logdate} %{DATA:logLevel} +\[%{DATA:threadName}\] .* - %{GREEDYDATA:msgBody}',
"message", '^(?<logdate>%{MONTHDAY}-%{MONTH}-%{YEAR} %{TIME}) %{DATA:logLevel}\s+(\[%{DATA:threadName}\]\s+)?%{GREEDYDATA:msgBody}',
"message", '%{GREEDYDATA:msgBody}'
]
Expand Down
Loading