admin管理员组文章数量:1794759
springboot中的access
springboot中的access-log access-log 用于springboot查看连接数,访问IP、线程号、访问url、返回状态码、访问时间、持续时间 在以往使用tomcat的过程中。tomcat 是会在logs下打印accesslog 的,来记录请求数,但是springboot内置的tomcat 默认情况下不打开。 不过一般nignx上打印accesslog,开不开这个也无所谓 accesslog配置 server.tomcat.accesslog.enabled=true 默认是false server.tomcat.accesslog.buffered=false server.tomcat.accesslog.directory=E://mall1/logs server.tomcat.accesslog.prefix=access_log server.tomcat.accesslog.file-date-format=.yyyy-MM-dd server.tomcat.accesslog.pattern=%t [%I] %{X-Forwarded-For}i %a %r %q %s (%D ms) //默认值是common
引用配置
server.tomcat.accesslog.buffered=true # Buffer output such that it is only flushed periodically. server.tomcat.accesslog.directory=logs # Directory in which log files are created. Can be relative to the tomcat base dir or absolute. server.tomcat.accesslog.enabled=false # Enable access log. server.tomcat.accesslog.file-date-format=.yyyy-MM-dd # Date format to place in log file name. server.tomcat.accesslog.pattern=common # Format pattern for access logs. server.tomcat.accesslog.prefix=access_log # Log file name prefix. server.tomcat.accesslog.rename-on-rotate=false # Defer inclusion of the date stamp in the file name until rotate time. server.tomcat.accesslog.request-attributes-enabled=false # Set request attributes for IP address, Hostname, protocol and port used for the request. server.tomcat.accesslog.rotate=true # Enable access log rotation. server.tomcat.accesslog.suffix=.log # Log file name suffix.更加详细的配置
技术交流群:809079777本文标签: SpringBootAccess
版权声明:本文标题:springboot中的access 内容由林淑君副主任自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.xiehuijuan.com/baike/1686966531a123323.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论