anchor.diff:  	<<Status:Offset/binary, 32, _Rest/binary>> = Event,
   	Acc#event{httpStatus = binary_to_integer(Status)}.
   
  -
  +-spec open_log(Directory, Log, LogSize, LogFiles) -> Result
  +	when
  +		Directory  :: string(),
  +		Log :: atom(),
  +		LogSize :: integer(),
  +		LogFiles :: integer(),
  +		Result :: ok | {error, Reason},
  +		Reason :: term().
  +%% @doc open disk log file
  +open_log(Directory, Log, LogSize, LogFiles) ->
  +	case file:make_dir(Directory) of
  +		ok ->
  +			open_log1(Directory, Log, LogSize, LogFiles);
  +		{error, eexist} ->
  +			open_log1(Directory, Log, LogSize, LogFiles);
  +		{error, Reason} ->
  +			{error, Reason}
  +	end.
  +%% @hidden
  +open_log1(Directory, Log, LogSize, LogFiles) ->
  +	FileName = Directory ++ "/" ++ atom_to_list(Log),
  +	case disk_log:open([{name, Log}, {file, FileName},
  +					{type, wrap}, {size, {LogSize, LogFiles}}]) of
  +		{ok, Log} ->
  +			ok;
  +		{repaired, Log, _Recovered, _Bad} ->
  +			ok;
  +		{error, Reason} ->
  +			Descr = lists:flatten(disk_log:format_error(Reason)),
  +			Trunc = lists:sublist(Descr, length(Descr) - 1),
  +			error_logger:error_report([Trunc, {module, ?MODULE},
  +					{log, Log}, {error, Reason}]),
  +			{error, Reason}
  +	end.
  +
  +-spec write_log(Log, Event) -> Result
  +	when
  +		Log :: atom(),
  +		Event :: list(),
  +		Result :: ok | {error, Reason},
  +		Reason :: term().
  +%% @doc write event into given log file
  +write_log(Log, Event) ->
  +	TS = erlang:system_time(?MILLISECOND),
  +	N = erlang:unique_integer([positive]),
  +	LogEvent = list_to_tuple([TS, N | Event]),
  +	disk_log:log(Log, LogEvent).
  +
  +-spec close_log(Log) -> Result
  +	when
  +		Log :: atom(),
  +		Result :: ok | {error, Reason},
  +		Reason :: term().
  +%% @doc close log files
  +close_log(Log) ->
  +	case disk_log:close(Log) of
  +		ok ->
  +			ok;
  +		{error, Reason} ->
  +			Descr = lists:flatten(disk_log:format_error(Reason)),
  +			Trunc = lists:sublist(Descr, length(Descr) - 1),
  +			error_logger:error_report([Trunc, {module, ?MODULE},
  +					{log, Log}, {error, Reason}]),
  +			{error, Reason}
  +	end.
  
positive.code: 		Reason :: term().
  %% @doc Close auth disk log.
  auth_close() ->
  	case disk_log:close(?AUTHLOG) of
  		ok ->
  			ok;
  		{error, Reason} ->
  			Descr = lists:flatten(disk_log:format_error(Reason)),
  			Trunc = lists:sublist(Descr, length(Descr) - 1),
  			error_logger:error_report([Trunc, {module, ?MODULE},
  					{log, ?AUTHLOG}, {error, Reason}]),
  			{error, Reason}
  	end.
  
  -record(event,
  		{host :: string(),
  
negative.code: 		Reason :: term().
  %% @doc Write a DIAMETER event to accounting log.
  acct_log(diameter = Protocol, Server, Type, Request, Response) ->
  	Event = [Protocol, node(), Server, Type, Request, Response],
  	write_log(?ACCTLOG, Event).
  
  -spec acct_close() -> Result
  	when
  