LoggiFly v1.8.0
This release introduces container event monitoring, enhanced notification templating, and new ntfy options.
Warning
In addition to v1.8.0 and latest, this release introduces v1.8 and v1 Docker tags.
It is possible that a v2 version with breaking changes and the removal of all deprecated fields will be released in the near future.
Users, especially those using automatic updating tools might be advised to use v1 instead of latest in their docker compose file.
Migration Notes
Config Field Renames
The following fields have been renamed. Old names still work because they are converted internally. However, they are deprecated and should still be updated in your config:
| Old Name | New Name |
|---|---|
notification_title
| title_template
|
json_template
| message_template
|
template
| message_template
|
disable_container_event_message
| disable_monitor_event_message
|
Environment variables: DISABLE_CONTAINER_EVENT_MESSAGE and NOTIFICATION_TITLE still work but are deprecated and should be replaced with DISABLE_MONITOR_EVENT_MESSAGE and TITLE_TEMPLATE.
Template download removed
The template file is no longer downloaded into /config. This feature probably was not used much and the config template has gotten really long and complex so it might be overwhelming for new users. A simple copy-paste might just be the easiest solution.
Highlights
- Container Events - Get notified when containers crash, become unhealthy, restart, and more
- Enhanced Templating - Unified
message_templateandtitle_templatewith access to more variables - New ntfy Options - Icon, click URL, markdown support, ntfy actions and custom headers
- Docker Healthcheck - Optional healthcheck to detect when LoggiFly fails to monitor docker hosts
You can find the configuration for the notifications from the image in the config example
New Features
Container Event Monitoring
Monitor container lifecycle events and trigger notifications or actions:
containers:
my-app:
container_events:
- event: unhealthy
- event: crash
action: restartSupported events: start, stop, die, crash, destroy, healthy, unhealthy, starting, oom, kill, create, restart
Note
As of today container_events can not be configured globally. This will be added in a future release.
For more information on container events visit the docs
Enhanced Notification Templating
Previously there were the following template settings available:
notification_title: had access to a few template fields like{container}and{keywords}json_template: had access to json fields of the log entry if it was formatted in jsontemplate: had access to fields defined via regex named capturing groups
These settings are deprecated, they will be converted to the following new settings internally (but should still be changed in your config):
The new template settings are title_template and message_template. Both have access to the exact same template fields.
They are both able to use extracted template fields from the log line via regex or directly from a json log entry.
New default template fields include:
- Container info:
container_name,container_id,full_container_id,docker_image,service_name,stack_name,target_name - Log info:
log_entry,keywords/keyword - Event info:
event,exit_code,signal - Action results:
action_type,action_target,action_result_message,action_succeeded,action_string - Timestamps:
timestamp,date,time,datetime - General info:
hostname,host_identifier,notification_type,monitor_type,
Invalid template fields now gracefully fall back instead of breaking the entire message.
Environment Variable Changes:
NOTIFICATION_TITLEis nowTITLE_TEMPLATE- New environment variable:
MESSAGE_TEMPLATE
For more information on the template fields and how to use them, visit the docs
New ntfy Options (by @elsherif896 & @clemcer)
notifications:
ntfy:
icon: "https://example.com/icon.png" # Custom notification icon
click: "https://my-dashboard.com" # URL opened on click
markdown: true # Enable markdown in message
actions: # ntfy actions (view, http, broadcast)
- action: "view"
label: "View Container"
url: "https://example.com/view"
- action: "http"
label: "Trigger http action"
url: "https://example.com/action"
- action: "broadcast"
label: "Take Action"
headers: # Custom HTTP headers
X-Custom-Header: "value"New environment variables:
NTFY_ICON- Custom notification iconNTFY_CLICK- URL opened on clickNTFY_MARKDOWN- Enable markdown in message
For more information on these settings visit the docs
Docker Healthcheck
LoggiFly now includes an optional Docker healthcheck that has to be added to the docker compose file. The healthcheck fails when LoggiFly is no longer able to monitor the Docker host.
New environment variables:
ENABLE_HEALTHCHECK- Enable the healthcheckHEARTBEAT_INTERVAL- Interval in seconds to write a heartbeat file to the filesystem
For more information visit the docs
Case-sensitive Regex
While case-sensitive regex matching should probably be the default, I did not want to break existing configurations. However, if you want to enforce case-sensitive matching, you can set regex_case_sensitive: true under settings (or even per container or trigger).
New environment variable: REGEX_CASE_SENSITIVE
Improvements
- Improved startup/reload summary - The status message is better formatted and now shows counts
- Enhanced webhook payload - JSON webhooks now include structured
info_fieldsandlog_fieldssections - Better config validation - Enhanced filtering and warning when config is invalid
- Emoji detection and encoding - Utility functions for detecting and encoding emojis for ntfy (rfc2047) (#57) (by @elsherif896)
- Better action result messages - Action result messages (appended to notification title) include error details and when an action is on cooldown now (note that this only works by default when not using a
title_template. If you are using one you should use theaction_result_messagetemplate field) - Swarm mode title prefix - System notifications include host identifier (e.g.,
[manager@node1]) when running in swarm mode
Bug Fixes
- Fixed config reload failing and causing configuration lock-out (#56)
- Fixed
keyword: keywordnot working inexcluded_keywords(#68)
Documentation
- four new config examples added (by @drake7707)
- added new docs page for healthcheck configuration and updated most of the other docs pages
Under the Hood
There has been a major refactoring to improve maintainability and enable future features.
Since there have been so many changes it is possible that not all improvements and bug fixes are listed in the release notes.
Contributors
- @elsherif896 - New ntfy options and emoji handling
- @drake7707 - Config examples
