anchor.diff:      {FullActionPayload, <<"environment">>, [{<<"entity_type">>, <<"environment">>},
                                               {<<"entity_name">>, Name}
                                              ]};
  +extract_entity_info(Req, #group_state{group_data = FullActionPayload}) ->
  +    Name = req_or_data_name(chef_wm_util:extract_from_path(group_name, Req), FullActionPayload),
  +    CorrectedName = get_corrected_name(Name, "groupname", FullActionPayload),
  +    {FullActionPayload, <<"group">>, [{<<"entity_type">>, <<"group">>},
  +                                      {<<"entity_name">>, CorrectedName}
  +                                     ]};
   extract_entity_info(Req, #node_state{node_data = FullActionPayload}) ->
       Name = req_or_data_name(chef_wm_util:object_name(node, Req), FullActionPayload),
       {FullActionPayload, <<"node">>, [{<<"entity_type">>, <<"node">>},
                                        {<<"entity_name">>, Name}
                                       ]};
  +extract_entity_info(_Req, #organization_state{organization_data = FullActionPayload,
  +                                              oc_chef_organization = #oc_chef_organization{name = Name}}) ->
  +    {FullActionPayload, <<"organization">>, [{<<"entity_type">>, <<"organization">>},
  +                                             {<<"entity_name">>, Name}
  +                                            ]};
   extract_entity_info(Req, #role_state{role_data = FullActionPayload}) ->
       Name = req_or_data_name(chef_wm_util:object_name(role, Req), FullActionPayload),
       {FullActionPayload, <<"role">>, [{<<"entity_type">>, <<"role">>},
  
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(),
  