I want to create log entries for a http server, but limit what the log entry contains. However, http_log/2 seems to always dump the entire text of every Request into the log entry in addition to the specific entry text that I want. I’m obviously doing something wrong, but I’m not sure what that is. Any suggestions?
Here’s the code I use (swipl version 8.0.3):
%... other preamble code, and then... :- use_module(library(http/http_log)). % ...later, the handler declaration... :- http_handler(root(.), frontpage,[prefix]). %...later still, the handler code... frontpage(Request):- get_time(T), format_time(atom(D),'%a %F %T %z (%Z)',T), member(peer(IP),Request), http_log('~w "/index.html accessed from ~w"',[D,IP]), http_reply_file(content('index.html'),,Request),!.