If log file path was specified in configuration (for all tracked changes - dynamic, umbrella apps etc).
Example:
On %{date} %{what} with id %{id} was %{action} by '%{whodoneit_name}' (id: %{whodoneit_id}).
where:
date: when
what: for example articleid: for example Article id
action: one of: ["create", "destroy", "update"]whodoneit_name: for example Johnwhodoneit_id: for example John's id
Optionally (in options):
log_formatter_module (if not specified use default formatter).
defmodule MyProject.LogFormatter
def format(what_was_it) do
# returns: {:ok, result} tuple where result is log string
end
end
Why? For example:
fail2ban or other third-party program - for example: rule to ban ip (matched with: whodoneit_id - same ip and same author/user) from which created too more entries (spam bot using REST API).
Somebody may not have accesss to database (company restrictions) - he only want to get all IP addresses (or last activity date) for John (grep by regex where for example whodoneit_id is 5). Here I mean server admin/user, not project web admin or project developer.
Good idea. I'm thinking this could be accomplished with a configurable callback hook. This way, you would add any processing you like when a new version record is generated.
If log file path was specified in configuration (for all tracked changes - dynamic, umbrella apps etc). Example:
On %{date} %{what} with id %{id} was %{action} by '%{whodoneit_name}' (id: %{whodoneit_id}).
where:date
: whenwhat
: for examplearticle
id
: for exampleArticle
idaction
: one of:["create", "destroy", "update"]
whodoneit_name
: for exampleJohn
whodoneit_id
: for exampleJohn
's idOptionally (in options):
log_formatter_module
(if not specified use default formatter).Why? For example:
whodoneit_id
- same ip and same author/user) from which created too more entries (spam bot using REST API).John
(grep by regex where for examplewhodoneit_id
is 5). Here I mean server admin/user, not project web admin or project developer.