Page tree

Old Release

This documentation covers an old version of Fedora. Looking for another version? See all documentation.

Skip to end of metadata
Go to start of metadata

Question

Is there advice on best practices for customizing Fedora 4 configuration files?

Best Practice 1

One recommended practice is to store modified configuration files outside of the unpacked war file.

 This is an example of production Fedora JAVA_OPTS:

JAVA_OPTS="-Dfile.encoding=UTF-8 \
  -Dfcrepo.home=/mnt/data/fcrepo \
  -Dfcrepo.modeshape.configuration=file:/etc/fcrepo/repository.json \
  -Dfcrepo.activemq.configuration=file:/etc/fcrepo/activemq.xml \
  -Dfcrepo.ispn.configuration=/etc/fcrepo/infinispan.xml \
  -Dfcrepo.auth.webac.authorization=/etc/fcrepo/root-authentication.ttl \
  -Dfcrepo.spring.audit.configuration=file:/etc/fcrepo/audit.xml \
  -Dlogback.configurationFile=/etc/fcrepo/logback.xml \
  -Dfcrepo.ispn.alternative.cache=ispn.alt.cache \
  -Dfcrepo.ispn.binary.cache=ispn.binary.cache \
  -Dfcrepo.ispn.cache=ispn.cache \
  -Dfcrepo.ispn.binary.alternative.cache=ispn.binary.alt.cache \
  -Dfcrepo.ispn.repo.cache=ispn.repo.cache \
  -Dfcrepo.modeshape.index.directory=modeshape.index \
  -Dfcrepo.binary.directory=binary.store \
  -Dfcrepo.activemq.directory=activemq \
  -Dcom.arjuna.ats.arjuna.common.ObjectStoreEnvironmentBean.default.objectStoreDir=arjuna.common.object.store \
  -Dcom.arjuna.ats.arjuna.objectstore.objectStoreDir=arjuna.object.store \
  -Dnet.sf.ehcache.skipUpdateCheck=true \
  -Dfcrepo.audit.container=/audit \
 
  # GC Configuration
  -XX:+UseConcMarkSweepGC \ 	# for smaller (< 4 GB) heaps
  -XX:+CMSClassUnloadingEnabled \ # for use with UseConcMarkSweepGC
  -XX:+UseG1GC \ 				# for larger (> 4 GB) heaps
  -XX:ConcGCThreads=5 \
  -XX:MaxGCPauseMillis=200
  -XX:ParallelGCThreads=20 \
 
  # Memory usage
  -XX:MaxMetaspaceSize=512M \
  -Xms1024m \ 					# minimum heap size
  -Xmx2048m"					# maximum heap size


You will see that all of the configuration files are stored outside of the unpacked war file. In this case, that is /etc/fcrepo, but it could be any place that makes sense for your system.

All of these configuration files may be customized, and by placing them in an administrator-controlled directory, any local changes are not overwritten when re-deploying a war file.

At a minimum, it is recommended that production deployments of Fedora store at least the following configuration files separately, and if you customize these at all, you should absolutely do this:

* repository.json (this is the central config for Modeshape, and you should control that)
* activemq.xml (common update: turn the topic into a queue)
* root-authentication.ttl (if you are using webac)
* logback.xml (common update: direct logging to /var/log/fcrepo/fcrepo.log rather than catalina.out)

 

Question

How do I configure logging output?

Best practice 1

Logging can be configured with a logback.xml file. For example, if you would like output to go to /var/log/fcrepo/fcrepo.log while rotating that log when it exceeds 20MB, this would be a possible configuration:

logback.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration>
<configuration>
  <property name="FCREPO_LOG_PATH" value="/var/log/fcrepo/fcrepo${logfile.extension:-.log}"/>
  <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
    <file>${FCREPO_LOG_PATH}</file>
    <encoder>
      <pattern>%d{dd-MMM HH:mm:ss.SSS} [%thread] %-5level %logger{35} - %msg %n</pattern>
    </encoder>

    <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
      <maxIndex>5</maxIndex>
      <minIndex>1</minIndex>
      <fileNamePattern>${FCREPO_LOG_PATH}.%i.gz</fileNamePattern>
	</rollingPolicy>

    <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
	  <maxFileSize>20MB</maxFileSize>
    </triggeringPolicy>
  </appender>
  
  <logger name="org.fcrepo.auth" additivity="false" level="${log.fcrepo.auth:-INFO}">
    <appender-ref ref="FILE"/>
  </logger>

  <logger name="org.fcrepo.connector.file" additivity="false" level="${log.fcrepo.connector.file:-INFO}">
    <appender-ref ref="FILE"/>
  </logger>

  <logger name="org.fcrepo.http.api" additivity="false" level="${log.fcrepo.http.api:-INFO}">
    <appender-ref ref="FILE"/>
  </logger>

  <logger name="org.fcrepo.http.commons" additivity="false" level="${log.fcrepo.http.commons:-INFO}">
    <appender-ref ref="FILE"/>
  </logger>

  <logger name="org.fcrepo.jms" additivity="false" level="${log.fcrepo.jms:-DEBUG}">
    <appender-ref ref="FILE"/>
  </logger>

  <logger name="org.fcrepo.kernel" additivity="false" level="${log.fcrepo.kernel:-INFO}">
    <appender-ref ref="FILE"/>
  </logger>

  <logger name="org.fcrepo.transform" additivity="false" level="${log.fcrepo.transform:-INFO}">
    <appender-ref ref="FILE"/>
  </logger>

  <logger name="org.fcrepo" additivity="false" level="${log.fcrepo:-INFO}">
    <appender-ref ref="FILE"/>
  </logger>

  <logger name="org.apache.activemq" additivity="false" level="WARN">
    <appender-ref ref="FILE"/>
  </logger>
  
  <root additivity="false" level="WARN">
    <appender-ref ref="FILE"/>
  </root>
</configuration>


If you customize this file, you should store it outside of the unpacked fcrepo.war directory by adding this to your JAVA_OPTS: "-Dlogback.configurationFile=/etc/fcrepo/logback.xml". Otherwise, when the application is re-deployed, your customizations will be lost.

  • No labels