Home > Java > javaTutorial > How SpringBoot configures tomcat access_log log

How SpringBoot configures tomcat access_log log

王林
Release: 2023-05-10 18:16:06
forward
1994 people have browsed it

Configure the tomcat accesslog log in the configuration file application.yml:

server:
  port: 80
  tomcat:
    accesslog:
      enabled: true
      directory: D:\Documents\D_代码相关\J_java\sprintboot_study
      prefix: tomcat_access_log
      suffix: .log
      file-date-format: -yyyy-MM-dd
      pattern: '%{X-Real-IP}i - %{Host}i %t "%r" %{Content-Length}i %s %b %D "%{Referer}i" "%{User-Agent}i" %a "%I" "-"'
      rotate: true
Copy after login

Log recording format (pattern), refer to the form:

nginx log log_format:

log_format main '$http_x_real_ip - $http_host [$time_local] "$request" $request_length '
                             '$status $body_bytes_sent $request_time "$http_referer" '
                             '"$http_user_agent" $remote_addr "-" "-" ';
Copy after login

tomcat access log pattern:

pattern: '%{X-Real-IP}i - %{Host}i %t "%r" %{Content-Length}i'
              '%s %b %D "%{Referer}i"'
             '"%{User-Agent}i" %a "%I" "-"'
Copy after login
rrree

The above is the detailed content of How SpringBoot configures tomcat access_log log. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template