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 by default). When the buffer exceeds its limit, the oldest events are discarded first.
A timer flushes the buffered events to an OpenSearch index (
fess_log.notification_queue) at 30-second intervals.The “Log Notification” scheduled job reads events from OpenSearch at 5-minute intervals, groups them by log level, and sends a notification for each level.
After notifications are sent, the processed events are deleted from the index.
Note
Each node sends notifications only for the logs it recorded itself (events are filtered by hostname). In a cluster configuration, separate notifications are sent for each node.
Note
To prevent infinite loops, logs from the loggers related to the notification feature itself (LogNotificationAppender, LogNotificationHelper, LogNotificationTarget, LogNotificationJob, NotificationHelper, and org.codelibs.curl, which is used for HTTP communication) are excluded from notification targets.
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 directly set the system properties (system.properties) that are saved in the General settings of the administration screen.
Notification Destination Configuration
The notification destinations (email recipients, Slack / Google Chat Webhook URLs) are all configured in the System -> General settings of the administration screen. Configure at least one notification destination. If no notification destination is configured, the log notification job terminates without sending anything.
Email Notification
To use email notification, the following configuration is required.
Mail server configuration (
fess_env.properties):Enter email addresses in Notification Mail in the General settings of the administration screen. Multiple addresses can be specified separated by commas.
Slack Notification
Enter a Slack Incoming Webhook URL in Slack Webhook URLs in the General settings of the administration screen. Multiple URLs can be specified separated by commas or whitespace. This value is saved as the system property slack.webhook.urls.
Google Chat Notification
Enter a Google Chat Webhook URL in Google Chat Webhook URLs in the General settings of the administration screen. Multiple URLs can be specified separated by commas or whitespace. This value is saved as the system property google.chat.webhook.urls.
Note
If you configure only the Slack or Google Chat Webhook URL without configuring Notification Mail, no email is sent and only the Slack / Google Chat notification is performed. The same subject and body as the email notification are sent to Slack / Google Chat as a message.
Configuration Properties
The following properties can be configured in fess_config.properties.
Note
Changes to log.notification.flush.interval take effect after restarting Fess. The other properties take effect from the next notification cycle.
Note
log.notification.interval is the value used for the “in the last N seconds” display text in the notification message; it does not change the job execution frequency. The actual execution interval is determined by the cron setting of the “Log Notification” scheduled job (5-minute intervals by default). To change the job execution interval, modify the cron expression of this job from System -> Scheduler, and adjust log.notification.interval accordingly so that the display matches the actual behavior.
Notification Message Format
Email Notification
Email notifications are sent in the following format.
Subject:
Body:
Note
ERROR and WARN events are sent as separate notifications for each level.
Note
When the number of events to display exceeds log.notification.max.display.events, the beginning of the details section becomes Total: N event(s) (showing M) and ... and X more is appended at the end. Each log message is truncated at the end with ... when it exceeds log.notification.max.message.length, and once the entire details section exceeds log.notification.max.details.length the remainder is discarded.
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 (the index name is the value of index.log (default fess_log) with .notification_queue appended). 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.
Note
The number of events processed in a single job execution is capped by log.notification.search.size (default 1,000). Events accumulated beyond this limit are discarded together after notifications are sent and are not carried over to subsequent executions. In environments where a large volume of logs occurs in a short period, raise log.notification.search.size as needed.
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
Check that at least one notification destination (Notification Mail, Slack Webhook URLs, or Google Chat Webhook URLs) is configured. If none are configured, the job outputs
No notification targets configured.and sends nothing.Verify mail server configuration
When using email notification, verify that the mail server is correctly configured in
fess_env.properties.Verify the scheduled job
Check that the “Log Notification” job is enabled in System -> Scheduler. If this job is disabled, no notifications are sent.
Check logs
Check
fess.logfor notification-related error messages.
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