springboot中的access-log

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值