Implement events logging feature

Record events (i.e. pluginhook's calls) as syslog entries and
provide a shortcut command to display the last part of the log
file.

A brief summary of the changes follows:

dokku:
 - New DOKKU_EVENTS_LOGFILE envvar to hold logfile location.

plugins/20_events/commands:
 - events output log entries, a tail's follow-like mode is
   provided too.
 - events:[on|off] enables/disables logging.
 - events:list lists events that are logged.

plugins/20_events/hook:
 - Generic hook that writes log entries. All the events are
   registered via symlink to this script.

plugins/common/functions:
 - dokku_log_event() writes log entries via logger.
 - dokku_log_pluginhook_call() formats log entries and writes
   them via dokku_log_event().
This commit is contained in:
Alessio Treglia committed 2015-06-26 14:47:18 +01:00
1 parent 48eca101f1
commit 783bb02b2c
33 files changed
+120

No files matched your search

+2
View File
@@ -10,6 +10,8 @@ export PLUGIN_PATH=${PLUGIN_PATH:="/var/lib/dokku/plugins"}
export DOKKU_NOT_IMPLEMENTED_EXIT=10
export DOKKU_VALID_EXIT=0
export DOKKU_EVENTS_LOGFILE=${DOKKU_EVENTS_LOGFILE:="/var/log/dokku.log"}
source "$PLUGIN_PATH/common/functions"
[[ -f $DOKKU_ROOT/dokkurc ]] && source $DOKKU_ROOT/dokkurc