在 /etc/apache2/apache2.conf 中:
LogFormat "%{User-agent}i" agent
在 /etc/apache2/sites-available/default-ssl.conf 中
CustomLog ${APACHE_LOG_DIR}/access_log_agent agent
/var/log/apache2/access_log_agent 每次访问都显示一个连字符:
-
-
-
为什么我无法记录用户代理?我在 Debian 9.6 上运行 Apache 2.4.25。
Loaded Modules:
core_module (static)
so_module (static)
watchdog_module (static)
http_module (static)
log_config_module (static)
logio_module (static)
version_module (static)
unixd_module (static)
access_compat_module (shared)
alias_module (shared)
auth_basic_module (shared)
authn_core_module (shared)
authn_file_module (shared)
authz_core_module (shared)
authz_host_module (shared)
authz_user_module (shared)
autoindex_module (shared)
deflate_module (shared)
dir_module (shared)
env_module (shared)
filter_module (shared)
mime_module (shared)
mpm_prefork_module (shared)
negotiation_module (shared)
php7_module (shared)
reqtimeout_module (shared)
rewrite_module (shared)
setenvif_module (shared)
socache_shmcb_module (shared)
ssl_module (shared)
status_module (shared)
答案1
我意外地在网络级别删除了用户代理。