Skip to content

Commit

Permalink
Merge pull request #38 from aodn/bugs/5385-gateway-timeout
Browse files Browse the repository at this point in the history
Reduce server cap and change fix log issues
  • Loading branch information
utas-raymondng authored May 8, 2024
2 parents cdf0e64 + 9758097 commit 43a5d17
Show file tree
Hide file tree
Showing 5 changed files with 296 additions and 242 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ ENV GN_DIR /opt/geonetwork

# Override log4j as we need to add our log appear, by default ROOT level is off which is very strange design
COPY ./geonetwork/target/classes/log4j-imos.xml ${GN_DIR}/WEB-INF/classes/log4j2.xml
COPY ./geonetwork/target/classes/log4j-imos-index.xml ${GN_DIR}/WEB-INF/classes/log4j2-index.xml

# Copy our jar to the lib folder so that scan can happens
COPY ./geonetwork/target/geonetwork-*.jar ${GN_DIR}/WEB-INF/lib/
Expand Down
4 changes: 3 additions & 1 deletion docker-es-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ services:
retries: 120
start_period: 20s

# Intended to set the max to 1G to match the cloud dev env, this can simulate issue with running in
# low memory environment.
es-container:
container_name: es-container
hostname: es-container
Expand All @@ -73,7 +75,7 @@ services:
env_file:
- .env
environment:
- ES_JAVA_OPTS=-Xms3g -Xmx4g
- ES_JAVA_OPTS=-Xms512m -Xmx1g
- xpack.security.enabled=true
- xpack.security.authc.api_key.enabled=true
- xpack.security.http.ssl.enabled=true
Expand Down
1 change: 1 addition & 0 deletions docker-gn-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ services:
env_file:
- .env
environment:
# If log is not working, add this to JAVA_OPTS to check what is going on -Dlog4j2.debug
JAVA_OPTS: >-
-Xms256m -Xmx2g
-Dspring.profiles.active=edge
Expand Down
150 changes: 150 additions & 0 deletions geonetwork/src/main/resources/log4j-imos-index.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="warn" dest="out">
<Properties>
<Property name="log_dir">.</Property>
</Properties>
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%date{ISO8601} %-5level [%logger] - %message%n"/>
</Console>
<RollingFile name="File">
<filename>${sys:log_dir:-log_dir}/logs/geonetwork.log</filename>
<filePattern>${sys:log_dir:-log_dir}/logs/geonetwork.log-%i.log</filePattern>
<PatternLayout pattern="%date{ISO8601} %-5level [%logger] - %message%n"/>
<Policies>
<SizeBasedTriggeringPolicy size="50 MB" />
</Policies>
<DefaultRolloverStrategy max="3" fileIndex="min"/>
</RollingFile>
<Routing name="Harvester">
<Routes pattern="$${ctx:logfile}">
<!-- value dynamically determines the name of the log file. -->
<Route>
<File name="harvester-${ctx:harvester}" fileName="${sys:log_dir:-log_dir}/${ctx:logfile:-harvester_default.log}">
<PatternLayout>
<pattern>%date{ISO8601}{${ctx:timeZone}} %-5level [%logger] - %message%n</pattern>
</PatternLayout>
</File>
</Route>
</Routes>
</Routing>
</Appenders>
<Loggers>
<!-- Geonetwork module (and submodule) logging -->
<Logger name="geonetwork" level="warn" additivity="false">
<AppenderRef ref="Console"/>
<AppenderRef ref="File"/>
</Logger>
<Logger name="geonetwork.accessmanager" level="error"/>
<Logger name="geonetwork.atom" level="info"/>
<Logger name="geonetwork.backup" level="error"/>
<Logger name="geonetwork.camel-harvester" level="error"/>
<Logger name="geonetwork.cors" level="error"/>
<Logger name="geonetwork.csw" level="error"/>
<Logger name="geonetwork.csw.search" level="error"/>
<Logger name="geonetwork.data.directory" level="error"/>
<Logger name="geonetwork.database" level="error"/>
<Logger name="geonetwork.databasemigration" level="info"/>
<Logger name="geonetwork.datamanager" level="error"/>
<Logger name="geonetwork.domain" level="error"/>
<Logger name="geonetwork.editor" level="error"/>
<Logger name="geonetwork.editorexpandelement" level="error"/>
<Logger name="geonetwork.editorfillelement" level="error"/>
<Logger name="geonetwork.encryptor" level="info"/>
<Logger name="geonetwork.formatter" level="error"/>
<Logger name="geonetwork.geoserver.publisher" level="error"/>
<Logger name="geonetwork.geoserver.rest" level="error"/>
<Logger name="geonetwork.harvest.wfs.features"/>
<Logger name="geonetwork.harvester" level="debug" additivity="false">
<AppenderRef ref="Console"/>
<AppenderRef ref="File"/>
</Logger>
<Logger name="geonetwork.harvest-man" level="info"/>
<Logger name="geonetwork.index" level="error"/>
<Logger name="geonetwork.ldap" level="error"/>
<Logger name="geonetwork.lucene" level="error"/>
<Logger name="geonetwork.mef" level="error"/>
<Logger name="geonetwork.resources" level="error"/>
<Logger name="geonetwork.schemamanager" level="error"/>
<Logger name="geonetwork.search" level="warn"/>
<Logger name="geonetwork.security" level="error"/>
<Logger name="geonetwork.spatineo" level="error"/>
<Logger name="geonetwork.sru" level="error"/>
<Logger name="geonetwork.sru.search" level="error"/>
<Logger name="geonetwork.thesaurus" level="error"/>
<Logger name="geonetwork.thesaurus-man" level="error"/>
<Logger name="geonetwork.userwatchlist" level="error"/>
<Logger name="geonetwork.wro4j" level="error"/>
<Logger name="geonetwork.doi" level="error"/>

<!-- Jeeves module and submodule logger configuration -->
<Logger name="geonetwork.engine" level="error"/>
<Logger name="geonetwork.monitor" level="error"/>
<Logger name="geonetwork.resources" level="error"/>
<Logger name="geonetwork.security" level="error"/>
<Logger name="geonetwork.transformerFactory" level="error"/>
<Logger name="geonetwork.xlinkprocessor" level="error"/>
<Logger name="geonetwork.xmlresolver" level="error"/>

<!-- Spring logging configuration -->
<Logger name="org.springframework" level="error" additivity="false">
<AppenderRef ref="Console"/>
<AppenderRef ref="File"/>
</Logger>
<Logger name="org.springframework.beans" level="error"/>
<Logger name="org.springframework.security" level="error"/>
<Logger name="org.springframework.security.ldap" level="error"/>
<Logger name="org.springframework.aop.framework.CglibAopProxy" level="error"/>

<Logger name="com.k_int" level="error" additivity="false">
<AppenderRef ref="Console"/>
<AppenderRef ref="File"/>
</Logger>

<!-- JZKIT logging configuration -->
<Logger name="org.jzkit" level="error" additivity="false">
<AppenderRef ref="Console"/>
<AppenderRef ref="File"/>
</Logger>
<Logger name="org.jzkit.a2j" level="error"/>
<Logger name="org.jzkit.search.impl.LRUCache" level="error"/>

<Logger name="ro.isdc.wro.http" level="error" additivity="false">
<AppenderRef ref="Console"/>
<AppenderRef ref="File"/>
</Logger>

<!-- Check domain/src/main/resources/config-spring-geonetwork.xml show_sql properties. -->
<Logger name="org.hibernate.SQL" level="error" additivity="false">
<AppenderRef ref="Console"/>
<AppenderRef ref="File"/>
</Logger>
<Logger name="org.hibernate.type" level="error" additivity="false">
<AppenderRef ref="Console"/>
<AppenderRef ref="File"/>
</Logger>
<Logger name="org.hibernate.tool.hbm2ddl" level="error" additivity="false">
<AppenderRef ref="Console"/>
<AppenderRef ref="File"/>
</Logger>
<Logger name="org.xhtmlrenderer" level="error" additivity="false">
<AppenderRef ref="Console"/>
<AppenderRef ref="File"/>
</Logger>

<Logger name="org.apache.camel" level="error" additivity="false">
<AppenderRef ref="Console"/>
<AppenderRef ref="File"/>
</Logger>

<Logger name="au.org.aodn.geonetwork4" level="debug" additivity="false">
<AppenderRef ref="Console"/>
<AppenderRef ref="File"/>
</Logger>

<!-- Turn off logging except when explicitly declared above -->
<Root level="off">
<AppenderRef ref="File"/>
</Root>
</Loggers>
</Configuration>
Loading

0 comments on commit 43a5d17

Please sign in to comment.