Issue
I'm using Spring boot 2.1.10 and I want to customize embedded tomcat access logs. I'm using this pattern in the application.yml file;
pattern: "[ACCESS] %{id}i %{x-forwarded-for}i %{client-ip}i %{server-ip}i %{dd.MM.yyyy}t %{HH:mm:ss}t %U %s %s %m %T %B %{user-agent}i"
The problem is, I cannot get C-DNS and S-DNS values. When I look at the tomcat documentation in this url, usage listed like this;
The following format tokens are supported:
- C-DNS - Remote hostname (or IP address if enableLookups for the connector is false)
- S-DNS - Local hostname
I tried it like this : %{c-dns}i or %{c-dns} or {c-dns} or c-dns nothing worked.
Do you have any suggestions?
Solution
I found the proper way with writing my own configuration class. Guide : Baeldung
Answered By - Habil