Tomcat Valve Component Audit log date format customisation

プラットフォームについて: Data Center のみ。 - This article only applies to Atlassian apps on the Data Center プラットフォーム

この KB は Data Center バージョンの製品用に作成されています。Data Center 固有ではない機能の Data Center KB は、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。 Server* 製品のサポートは 2024 年 2 月 15 日に終了しました。Server 製品を実行している場合は、 アトラシアン Server サポート終了 のお知らせにアクセスして、移行オプションを確認してください。

*Fisheye および Crucible は除く

要約

When enabling the access log via Tomcat's Valve Component, the default log date format is dd/M/yyyy:hh:mm:ss:

[29/Sep/2020:15:17:19 +1000] Apache-HttpClient/4.5.6 (Java/1.8.0_151) 127.0.0.1 GET GET /c740/rest/gadgets/1.0/g/messagebundle/und/gadget.common%2Cgadget.activity.stream HTTP/1.1 3910 200 1652 http-nio-6740-exec-1

This can be customised to a different format such as yyyy-MM-dd hh:mm:ss

環境

Tomcat

ソリューション

Below is an example of how to do this in server.xml file:

<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" requestAttributesEnabled="true" prefix="confluence_access_log" suffix=".log" pattern="%{yyyy-MM-dd HH:mm:ss.SSSZ}t %{X-AUSERNAME}o %{User-Agent}i %h %m %r %b %s %D %I" />

出力:

2020-09-29 15:26:38.384+1000 - Apache-HttpClient/4.5.6 (Java/1.8.0_151) 127.0.0.1 GET GET /c740/rest/gadgets/1.0/g/messagebundle/und/gadget.common%2Cgadget.activity.stream HTTP/1.1 3910 200 1652 http-nio-6740-exec-10

更新日時: September 26, 2025

さらにヘルプが必要ですか?

アトラシアン コミュニティをご利用ください。