問題描述
如何更改 WSO2 中 wso2api/repository/logs 目錄下 httpaccess.log 文件中的日誌模式 (How to change log pattern in httpaccess.log file under the directory wso2api/repository/logs in WSO2)
我在 catalina 服務器 xml 文件中更新了以下配置。
Valve className="org.apache.catalina.valves.AccessLogValve" directory="${carbon.home}/repository/logs"
prefix="http_access_" suffix=".log"
pattern="combined"
我所做的任何更改(模式、目錄路徑)都會影響文件 http_access_Date.log
文件,但不影響 http_access_.log
文件。
請提供任何建議。
API 執行日誌記錄到 http_access_.log
文件。如何管理這個文件和這個文件中的模式?
參考解法
方法 1:
http_acccess_.log
file contains passthrough and NIO transport traffic‑related logs, and that is not configured via the above tomcat valve.
For that, you need to update log4j.properties
file like this.
log4j.logger.org.apache.synapse.transport.http.access=INFO
and the access‑log.properties
like this.
access_log_pattern=%h %l %u %t "%r" %s %b "%{Referer}i" "%{User‑Agent}i"
See this doc for more details.