anchor.diff:  %%--------------------------------------------------------------------
   %%% INNER FUNCTIONS
   %%--------------------------------------------------------------------
  +%% @private
  +get_env(Props) ->
  +    Host    = leo_misc:get_value(?ESEARCH_PROP_HOST,    Props, ?DEF_ESEARCH_HOST),
  +    Port    = leo_misc:get_value(?ESEARCH_PROP_PORT,    Props, ?DEF_ESEARCH_PORT),
  +    Timeout = leo_misc:get_value(?ESEARCH_PROP_TIMEOUT, Props, ?DEF_ESEARCH_TIMEOUT),
  +    {list_to_binary(Host), Port, Timeout}.
   
  
positive.code:              ok).
  append(#message_log{formatted_msg = FormattedMsg,
                      esearch = ESearch}, #logger_state{props = Props} = _State) ->
      Host    = leo_misc:get_value(?ESEARCH_PROP_HOST,    Props, ?DEF_ESEARCH_HOST),
      Port    = leo_misc:get_value(?ESEARCH_PROP_PORT,    Props, ?DEF_ESEARCH_PORT),
      Timeout = leo_misc:get_value(?ESEARCH_PROP_TIMEOUT, Props, ?DEF_ESEARCH_TIMEOUT),
      Index   = leo_misc:get_value(?ESEARCH_DOC_INDEX,    ESearch),
      Type    = leo_misc:get_value(?ESEARCH_DOC_TYPE,     ESearch),
  
      catch erlastic_search:index_doc(#erls_params{host     = list_to_binary(Host),
                                                   port     = Port,
                                                   timeout  = Timeout,
                                                   ctimeout = Timeout},
  
negative.code: -spec(rotate(integer(), #logger_state{}) ->
               {ok, #logger_state{}}).
  rotate(Hours, #logger_state{props = Props} = State) ->
      {Host, Port, Timeout} = get_env(Props),
      catch erlastic_search:flush_all(#erls_params{host     = Host,
                                                   port     = Port,
                                                   timeout  = Timeout,
  