anchor.diff:  -export([start_link/1]).
   -export([init/1, handle_call/3, handle_cast/2, handle_info/2,
            terminate/2, code_change/3]).
  --export([log_access/1, refresh/0, get_metadata/2]).
  +-export([log_access/1, log_message/1, refresh/0, get_metadata/2]).
   
   -include_lib("wm_reqdata.hrl").
   -include_lib("webmachine_logger.hrl").
   
   -record(state, {hourstamp, filename, handle}).
   
  +%%
  +%% Api
  +%%
  +
   alog_path(BaseDir) ->
       filename:join(BaseDir, "access.log").
   
   start_link(BaseDir) ->
       gen_server:start_link({local, ?MODULE}, ?MODULE, [BaseDir], []).
  +
  +refresh() ->
  +    refresh(os:timestamp()).
  +
  +refresh(Time) ->
  +    gen_server:cast(?MODULE, {refresh, Time}).
  +
  +log_access(#wm_log_data{}=D) ->
  +    gen_server:cast(?MODULE, {log_access, D}).
  +
  +log_message(Msg) ->
  +    gen_server:cast(?MODULE, {log_message, Msg}).
  +
  +%%
  +%% gen_server callbacks
  +%%
   
   init([BaseDir]) ->
       defer_refresh(),
  
positive.code:     Handle = log_open(FileName, DateHour),
      {ok, #state{filename=FileName, handle=Handle, hourstamp=DateHour}}.
  
  refresh() ->
      refresh(os:timestamp()).
  
  refresh(Time) ->
      gen_server:cast(?MODULE, {refresh, Time}).
  
  log_access(#wm_log_data{}=D) ->
      gen_server:cast(?MODULE, {log_access, D}).
  
  handle_call(_Msg,_From,State) -> {noreply,State}.
  
  handle_cast({log_access, LogData}, State) ->
      NewState = maybe_rotate(State, os:timestamp()),
      Msg = format_req(LogData),
      log_write(NewState#state.handle, Msg),
      {noreply, NewState};
  handle_cast({refresh, Time}, State) ->
      {noreply, maybe_rotate(State, Time)}.
  
  
negative.code: 
  code_change(_OldVsn, State, _Extra) ->
      {ok, State}.
  
  %%
  %% Helpers
  %%
  
  log_open(FileName, DateHour) ->
      LogName = FileName ++ suffix(DateHour),
  