anchor.diff:          Else ->
               key_for_method(Else)
       end;
  +%'DELETE' request could mean both dissociate or reject,
  +%hence we look into the log message to identify.
  +task(Req, #base_state{resource_state=#association_state{}, log_msg = LogMsg}) ->
  +    case wrq:method(Req) of
  +        'POST' ->
  +            <<"invite">>;
  +        'PUT' ->
  +            <<"associate">>;
  +        'DELETE' ->
  +            case element(1, LogMsg) of
  +                removed -> <<"dissociate">>;
  +                invite_deleted -> <<"reject">>
  +            end
  +    end;
   task(Req, _State)->
       key_for_method(wrq:method(Req)).
   
   -spec key_for_method('POST'|'PUT'|'DELETE') -> <<_:48>>.
  +key_for_method('DELETE') ->
  +    <<"delete">>;
   key_for_method('POST') ->
       <<"create">>;
   key_for_method('PUT') ->
  -    <<"update">>;
  -key_for_method('DELETE') ->
  -    <<"delete">>.
  +    <<"update">>.
   
   req_or_data_name(undefined, Data) ->
       ej:get({<<"name">>}, Data);
  
positive.code:                   EntitySpecificPayload) ->
      Msg = {[{<<"message_type">>, <<"action">>},
              {<<"message_version">>, ?CHEF_ACTIONS_MESSAGE_VERSION},
              {<<"organization_name">>, OrgName},
              %% Request Level Info
              {<<"service_hostname">>, hostname()},
              {<<"recorded_at">>, req_header("x-ops-timestamp", Req)},
  
negative.code:     %% TODO - chef_wm_environments endpoint puts a chef_environment{} directly
      %% into the resource_state record
      ok;
  log_action(Req, #base_state{resource_state = ResourceState,
                              resource_mod = ResourceMod} = State) when
          is_record(ResourceState, association_state);
          is_record(ResourceState, client_state);
          is_record(ResourceState, cookbook_state);
          is_record(ResourceState, data_state);
          is_record(ResourceState, environment_state);
          is_record(ResourceState, group_state);
          is_record(ResourceState, organization_state);
          is_record(ResourceState, node_state);
          is_record(ResourceState, role_state);
          is_record(ResourceState, user_state) ->
      case wrq:method(Req) of
          'GET' ->
              ok;
          _ElseMethod -> %% POST, PUT, DELETE
              case ResourceMod of
                  oc_chef_wm_authenticate_user ->  %% POST to authenticate_user should not be an action.
                      ok;
                  _ElseMod ->
                      case wrq:response_code(Req) of
                          Code when Code =:= 200; Code =:= 201 ->
                              log_action0(Req, State);
                          _ElseStatus ->
                              ok
                      end
              end
      end;
  log_action(Req, #base_state{resource_state = ResourceState} = State) ->
      ShouldLogUnEnabledActions = envy:get(oc_chef_wm, log_unenabled_actions, false, boolean),
      case ShouldLogUnEnabledActions of
          true -> Task = task(Req, State),
              lager:info("Action ~p not enabled for ~p\n", [Task, ResourceState]);
          false -> ok
      end.
  
  -spec  log_action0(Req :: wm_req(),
  