Overview
Fess has a feature that automatically captures ERROR and WARN level log events and notifies administrators. This feature enables rapid detection of system anomalies and early initiation of incident response.
Key features:
Supported notification channels: Email, Slack, Google Chat
Target processes: Main application, crawler, suggest generation, thumbnail generation
Disabled by default: Since this is an opt-in feature, it must be explicitly enabled
How It Works
Log notification operates through the following flow:
Log4j2’s
LogNotificationAppendercaptures log events at or above the configured level.Captured events are accumulated in an in-memory buffer (up to 1,000 entries).
A timer flushes the buffered events to an OpenSearch index (
fess_log.notification_queue) at 30-second intervals.A scheduled job reads events from OpenSearch at 5-minute intervals, groups them by log level, and sends notifications.
After notifications are sent, processed events are deleted from the index.
Note
Logs from the notification feature itself (such as LogNotificationHelper and LogNotificationJob) are excluded from notification targets to prevent infinite loops.
Setup
Enabling
Enabling from the Administration Screen
Log in to the administration screen.
Select “General” from the “System” menu.
Enable the “Log Notification” checkbox.
Select the target level in “Log Notification Level” (
ERROR,WARN,INFO,DEBUG,TRACE).Click the “Update” button.
Note
By default, only ERROR level events are targeted for notification. If you select WARN, both WARN and ERROR events will be notified.
Enabling via System Properties
You can also enable the feature by directly setting the system properties saved in the “General” settings of the administration screen.
log.notification.enabled=true
fess.log.notification.level=ERROR
Notification Destination Configuration
Email Notification
To use email notification, the following configuration is required.
Mail server configuration (
fess_env.properties):mail.smtp.server.main.host.and.port=smtp.example.com:587
Enter an email address in “Notification Destination” in the “General” settings of the administration screen. Multiple addresses can be specified separated by commas.
Slack Notification
You can send notifications to a Slack channel by configuring a Slack Incoming Webhook URL.
Google Chat Notification
You can send notifications to a Google Chat space by configuring a Google Chat Webhook URL.
Configuration Properties
The following properties can be configured in fess_config.properties.
Note
Changes to these properties take effect after restarting Fess.
Notification Message Format
Email Notification
Email notifications are sent in the following format.
Subject:
[FESS] ERROR Log Alert: hostname
Body:
--- Server Info ---
Host Name: hostname
--- Log Summary ---
Level: ERROR
Total: 5 event(s) in the last 300 seconds
--- Log Details ---
[2025-03-26T10:30:45.123] ERROR org.codelibs.fess.crawler - Connection timeout
[2025-03-26T10:30:46.456] ERROR org.codelibs.fess.app.web - Failed to process request
Note: See the log files for full details.
Note
ERROR and WARN events are sent as separate notifications for each level.
Slack / Google Chat Notification
Slack and Google Chat notifications are sent as messages with similar content.
Operations Guide
Recommended Settings
| Environment | Recommended Level | Reason |
|---|---|---|
| Production | ERROR | Notify only on critical errors and reduce noise |
| Staging | WARN | Include potential issues in notifications |
| Development | Disabled | Check log files directly |
OpenSearch Index
The log notification feature uses the fess_log.notification_queue index for temporary event storage. This index is automatically created when the feature is first used. Since events are deleted after notifications are sent, the index size does not typically grow large.
Troubleshooting
Notifications Are Not Being Sent
Verify enablement
Check that “Log Notification” is enabled in the “General” settings of the administration screen.
Verify notification destination
For email notification, verify that an email address is configured in “Notification Destination”.
Verify mail server configuration
Verify that the mail server is correctly configured in
fess_env.properties.Check logs
Check
fess.logfor notification-related error messages.grep -i "notification" /var/log/fess/fess.log
Too Many Notifications
Raise the log level
Change the notification level from
WARNtoERROR.Address root causes
If errors are occurring frequently, investigate the root cause of the errors.
Notification Content Is Truncated
Adjust the following properties:
log.notification.max.details.length: Maximum character count for the details sectionlog.notification.max.display.events: Maximum number of events to displaylog.notification.max.message.length: Maximum character count for each message
References
Log Configuration - Log Configuration
Memory Configuration - Memory Configuration