如何配置Spring Boot应用程序侦听的TCP/IP端口,因此它不使用默认端口8080.
我想在文件中记录SQL语句.
我有以下属性application.properties
spring.datasource.url=...
spring.datasource.username=user
spring.datasource.password=1234
spring.datasource.driver-class-name=net.sourceforge.jtds.jdbc.Driver
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.format_sql=true
security.ignored=true
security.basic.enabled=false
logging.level.org.springframework.web=INFO
logging.level.org.hibernate=INFO
logging.file=c:/temp/my-log/app.log
Run Code Online (Sandbox Code Playgroud)
当我运行我的应用程序
cmd>mvn spring-boot:run
Run Code Online (Sandbox Code Playgroud)
我可以在控制台中看到sql语句,但它们不会出现在app.log文件中.该文件仅包含spring的基本日志.
如何在日志文件中查看sql语句?
这是一个非常简单的问题,但我找不到相关信息.
(也许我对Java框架的了解非常严重)
如何使用application.properties设置日志记录级别?
并记录文件位置等?
我想访问提供的值application.properties,例如:
logging.level.org.springframework.web: DEBUG
logging.level.org.hibernate: ERROR
logging.file=${HOME}/application.log
userBucket.path=${HOME}/bucket
Run Code Online (Sandbox Code Playgroud)
我想userBucket.path在Spring Boot应用程序中访问我的主程序.
当我创建了一个春天启动应用程序,我可以看到mvnw和mvnw.cmd文件在项目的根.这两个文件的目的是什么?
我想知道,如果Filter在Spring Boot中有一个类(用于Web应用程序)的注释?也许@Filter吧?
我想在我的项目中添加自定义过滤器.
Spring Boot Reference Guide提到了
FilterRegistrationBean,但我不知道如何使用它.
在spring boot中将属性放在application.yml或bootstrap.yml上有什么区别?在logging.config情况下,应用程序的工作方式不同.
这是尝试运行我的Web应用程序时引发的错误:
[INFO] WARNING: Nested in org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private javax.sql.DataSource org.springframework.boot.autoconfigure.orm.jpa.JpaBaseConfiguration.dataSource; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceAutoConfiguration$NonEmbeddedConfiguration.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public javax.sql.DataSource org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration$NonEmbeddedConfiguration.dataSource()] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Cannot determine embedded database driver class for database type NONE. If you want an embedded database please …Run Code Online (Sandbox Code Playgroud) 我刚开始学习Spring.在下一步中,我想开发更大的Web应用程序.现在我想知道我是否应该从Spring Boot或Spring MVC开始.我已经阅读了一些东西,但它有点令人困惑,因为两者看起来都很相似.那么这两者有什么不同呢?
如何在Linux系统中很好地配置Spring Boot应用程序打包为可执行jar作为服务?这是推荐的方法,还是应该将此应用程序转换为war并安装到Tomcat中?
目前我可以从screen会话中运行Spring启动应用程序,这很不错,但需要在服务器重启后手动启动.
我正在寻找的是一般建议/方向或示例init.d脚本,如果我使用可执行jar的方法是正确的.
spring-boot ×10
java ×6
spring ×4
logging ×2
hibernate ×1
init.d ×1
jpa ×1
maven ×1
port ×1
server ×1
service ×1
spring-cloud ×1
spring-data ×1
spring-mvc ×1
startup ×1