springboot

  • 与mybatis集成
  • 打开内嵌tomcat access日志
  • 使用tomcat Servlet、Filter、Listener

与mybatis集成

参考链接

打开内嵌tomcat access日志

参考链接

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.

比较常用的有(省略了前缀server.tomcat.accesslog.):

  • enabled,取值true、false,需要accesslog时设置为true
  • directory,指定access文件的路径
  • pattern,定义日志的格式,后续详述
  • rotate,指定是否启用日志轮转。默认为true。这个参数决定是否需要切换切换日志文件,如果被设置为false,则日志文件不会切换,即所有文件打到同一个日志文件中,并且file-date-format参数也会被忽略

使用tomcat Servlet、Filter、Listener

参考链接

你可能感兴趣的:(springboot)