Skip to content
Permalink
Browse files
Fuseki logging, modules and notes for Tomcat9
  • Loading branch information
afs committed Dec 1, 2020
1 parent 50f670b commit 096543bd3ec11c981709fb9c4f6e4f31c1fef0e8
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 3 deletions.
@@ -35,8 +35,8 @@ transactional persistent storage layer, and incorporates
- [As a Docker container](fuseki-main#fuseki-docker)
- [As an embedded SPARQL server](fuseki-embedded.html)
- [Security and data access control](fuseki-data-access-control.html)
- [Logging](fuseki-logging.html)
- [Fuseki Configuration](fuseki-configuration.html)
- [Logging](fuseki-logging.html)
- [Server Statistics and Metrics](fuseki-server-info.html)
- [How to Contribute](#how-to-contribute)
- Client access
@@ -118,3 +118,21 @@ Development builds (not a formal release):

Source code:
[https://github.com/apache/jena/tree/master/jena-fuseki2](https://github.com/apache/jena/tree/master/jena-fuseki2)

The Fuseki module are under "jena-fuseki2/":

| Fuseki Module | Purpose |
|---------------|-|
| jena-fuseki-core | The Fuseki engine. All SPARQL operations.
| <b>Webapp </b> | |
| jena-fuseki-webapp | Web application and command line startup |
| jena-fuseki-fulljar | Build the combined jar for Fuseki/UI server |
| jena-fuseki-war | Build the war file for Fusek/UI server |
| apache-jena-fuseki | The download for Fuskei |
| <b>Fuseki/Main</b> | |
| jena-fuseki-main | Embedded server and command line
| jena-fuseki-server | Build the combined jar for Fusek/main server |
| jena-fuseki-docker | Build a docker conntained based on Fusek/main |
| <b>Other</b> | |
| jena-fuseki-access | [Data access control](fuseki-data-access-control.html) |
| jena-fuseki-geosparql | Integration for GeoSPARQL |
@@ -32,11 +32,10 @@ or reverse proxy will log access requests anyway.

## Setting logging

The Fuseki engine looks for the log4j2 configuration as follows:
The Fuseki Main engine looks for the log4j2 configuration as follows:

* Use system property `log4j2.configurationFile` if defined ([as usual for log4j2](https://logging.apache.org/log4j/2.x/manual/configuration.html)).
* Use `file:log4j2.properties` (current directory) if it exists
* Use file `log4j2.properties` in the directory defined by `FUSEKI_BASE` (webapp)
* Use java resource `log4j2.properties` on the classpath.
* Use java resource `org/apache/jena/fuseki/log4j2.properties` on the classpath.
* Use a built-in configuration.
@@ -96,3 +96,46 @@ local machine.
When deploying as a web application a more fully featured Admin API is
made available and described on the
[Fuseki Server Protocol (REST API)](fuseki-server-protocol.html) page.

## Configuring logging

When running from a WAR file in a webapp container such as Apache Tomcat, the
logging configuration comes from the file `log4j2.properties` in the root of the
unpacked war file, e.g. `/var/lib/tomcat9/webapps/fuseki/log4j2.properties`.

The name of the file is taken from `web.xml`:

<context-param>
<param-name>log4jConfiguration</param-name>
<param-value>log4j2.properties</param-value>
</context-param>

Thsi only applies when running in a webapp container. When run from the command
line, the server looks for `log4j2.properties` in the current directory and if
not found, uses a built-in configuration.

This logging goes to the standard output.

## Fuseki with Tomcat9 and systemd

`systemd` may be set to sandbox Tomcat9. The file area `/etc/fuseki` will not
be writable to Fuseki. To enable this area, add `ReadWritePaths=/etc/fuseki/` to
the file `/etc/systemd/system/tomcat9.service.d/override.conf`,
creating the file if necessary.

`systemd` also captures standard out and routes it to the system journal:

```
journalctl -u tomcat9
```

To direct the output to the traditional location of
/var/log/tomcat9/catalina.out use the `StandardOutput` setting in `override.conf`:

```
[Service]
# Allow access to the Fuseki area
ReadWritePaths=/etc/fuseki/
StandardOutput=file:/var/log/tomcat9/catalina.out
```

0 comments on commit 096543b

Please sign in to comment.