我正在尝试为 2 个嵌套类记录器单独设置日志记录级别,一个示例是名为的记录器:
com.package.ParentClass$LoggerOne和com.package.ParentClass$LoggerTwo。在 logback.xml 文件中为这些确切的记录器添加记录器工作正常,但在尝试为 Spring Boot 的属性组设置记录器时似乎没有任何效果logging.level。
具有这些记录器的类看起来像这样:
class ParentClass {
private static Logger logger = LoggerFactory.getLogger(ParentClass.class);
// code that uses ParentClass logger
class LoggerOne {
private static Logger logger = LoggerFactory.getLogger(LoggerOne.class);
// code that uses LoggerOne logger
}
class LoggerTwo {
private static Logger logger = LoggerFactory.getLogger(LoggerTwo.class);
// code that uses LoggerTwo logger
}
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试运行命令“ flutter build appbundle --verbose”来生成我的应用程序的 Android 版本,但收到错误“ Gradle task bundleRelease failed with exit code 1”。
我还不知道很多关于 gradle 的事情以及你对每个包的依赖关系,我已经阅读了一些堆栈溢出答案,重构了文件bundle.properties等,但没有成功。这是我的构建信息:
flutter build appbundle --verbose输出的一部分
:flutter_secure_storage:bundleLibCompileRelease [ ]
********************************************************* [ ] WARNING: This version of firebase_messaging will break your Android
build if it or its dependencies aren't compatible with AndroidX. [
] See xxxxxxx for more information on the
problem and how to fix it. [ ] This warning prints for
all Android build failures. The real root …Run Code Online (Sandbox Code Playgroud) 在参数化构造函数中传递值时,我无法自动装配 bean。
如何使用 SpringBoot 调用参数化构造函数?
@Component
public class MainClass {
public void someTask() {
AnotherClass obj = new AnotherClass(1, 2);
}
}
//Replace the new AnotherClass(1, 2) using Autowire?
@Component
public class AnotherClass {
private int number,age;
public AnotherClass(int number, int age) {
super();
this.number = number;
this.age = age;
}
}
Run Code Online (Sandbox Code Playgroud)
我想自动装配“AnotherClass”bean。如何删除new AnotherClass(1, 2);
我如何放置@Autowire在这里?
constructor dependency-injection parameter-passing spring-boot