Tomcat Log Provider icon
Module Id
tomcat-log-provider
Group Id
org.jahia.community
Updated
Requires Jahia
8.2.1.0
Author
Florent BOURASSE
Category
Tools and Utilities
Status
COMMUNITY info

Tomcat Log Provider group_work

log cloud

A Jahia community module (not officially supported by Jahia) that mounts the Tomcat log directory into the JCR content tree, making log files accessible in read-only mode through the document manager.

Dependencies & Dependants

Dependants
  • NONE

Changelog 2.0.3

FAQ

Configuration

The module reads its settings from the OSGi configuration file:

$JAHIA_DATA_DIR/karaf/etc/org.jahia.modules.tomcatlogprovider.cfg
Property Default Description
mountPath /sites/systemsite/files/tomcat-logs JCR path where the Tomcat log directory will be mounted

Changes to the configuration file are applied immediately — the provider remounts at the new path without a restart.

Admin UI

Settings can also be edited in the Jahia administration panel:

Administration → Tomcat Log Provider → Configuration

The panel shows:

  • The resolved Tomcat log directory path on disk (${catalina.base}/logs) — read-only
  • The JCR mount path — editable, saved via the Save settings button

GraphQL API

The module exposes two queries and one mutation under the graphql-dxm-provider extension point.

Queries

# Returns current settings
query {
    tomcatLogSettings {
        mountPath   # current JCR mount path
        logPath     # resolved on-disk log directory
    }
}

# Returns the last N lines of jahia.log (default: 200)
query {
    tomcatLogTail(lines: 200)
}

Mutation

# Saves the mount path and triggers a remount; returns true on success
mutation {
    tomcatLogSaveSettings(mountPath: "/sites/systemsite/files/tomcat-logs")
}

All operations require the admin permission.

Live log viewer

A dedicated administration page streams the last 200 lines of jahia.log in real time, refreshing every 2 seconds:

Administration → Tomcat Log Provider → Live log viewer

The terminal auto-scrolls to the latest entries. Scrolling up pauses auto-scroll; scrolling back to the bottom resumes it.

How it works

  • The module registers an ExternalContentStoreProvider backed by Apache Commons VFS2, pointing at ${catalina.base}/logs
  • Log files appear as jnt:file nodes and subdirectories as jnt:folder nodes under the configured mount path
  • All write operations are rejected — the provider is strictly read-only
  • Access is restricted to users who are members of the systemsite administrators group

Security

Note: the mount path is accessible through the Jahia document manager. Restrict access to the mount point using Jahia's built-in ACL system to prevent non-admin users from browsing server log files.

How To Install

Requirements

  • Jahia 8.2.1 or later
  • external-provider module
  • graphql-dxm-provider module

Installation

In Jahia, go to Administration → Server settings → System components → Modules

  1. Upload the JAR tomcat-log-provider-X.X.X.jar
  2. Verify the module status is Started

The provider mounts automatically at the default JCR path /sites/systemsite/files/tomcat-logs.

License

MIT License

Copyright (c) 2019 - present Jahia

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.