Logging

EDG uses the slf4j/log4j logging library. As a result, the customer can set the log level, the format of the log, and the log file rotation policy. The current EDG log can be downloaded via the EDG Log Admin Link. The startup and access logs are maintained by the container (i.e. Tomcat).

To configure the log file size and rotation policy, modify the EDG configuration file <CATALINA_BASE>/webapps/edg/WEB-INF/setupdata/log4j2-base.xml.

To enable logging that may be helpful with debugging startup problems, edit the Tomcat configuration file <CATALINA_BASE>/conf/logging.properties:

  • Add the lines below:

    5edg.org.apache.juli.AsyncFileHandler.level = FINE
    5edg.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs
    5edg.org.apache.juli.AsyncFileHandler.prefix = edg.
    5edg.org.apache.juli.AsyncFileHandler.maxDays = 90
    5edg.org.apache.juli.AsyncFileHandler.encoding = UTF-8
    
    org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/edg].level = INFO
    org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/edg].handlers = 5edg.org.apache.juli.FileHandler
    
  • Replace the line with the handlers setting with this line, which should simply add 5edg.org.apache.juli.AsyncFileHandler to the list of handlers:

    handlers = 1catalina.org.apache.juli.AsyncFileHandler, 2localhost.org.apache.juli.AsyncFileHandler, 3manager.org.apache.juli.AsyncFileHandler, 4host-manager.org.apache.juli.AsyncFileHandler, 5edg.org.apache.juli.AsyncFileHandler, java.util.logging.ConsoleHandler
    

Other Settings

Tomcat Access Log

Because EDG does not use Tomcat’s built-in authentication service, the EDG username is not included in the default Tomcat access log. This access log is typically configured to be named something like <CATALINA_BASE>/logs/localhost_access_log.yyyy-mm-dd.txt.

To include the EDG username in Tomcat’s access log, edit the Tomcat <CATALINA_BASE>/conf/server.xml file and modify the AccessLogValve entry (typically located at the bottom of the file). The pattern must now include a new pattern code, %{username}s. The default pattern, which looks like this:

pattern="%h %l %u %t &quot;%r&quot; %s %b"

should be changed to this:

pattern="%h %l %{username}s %t &quot;%r&quot; %s %b"

i.e. replacing %u with %{username}s. See the Tomcat Access Log documentation for more information.

Tomcat SSL Support

If Tomcat is configured with an HTTP connector with SSL support and no exclusion rule, the connector will require some characters to be encoded. This can cause problems with embedded links. Add the following attribute settings to the HTTP connector in the file <CATALINA_BASE>/conf/server.xml:

  • relaxedPathChars="&lt;&gt;"

  • relaxedQueryChars="&lt;&gt;"