小编Gol*_*olu的帖子

这些angular-cli做了什么:inline.bundle.js,vendor.bundle.js,main.bundle.js?

如果我检查使用angular-cli创建的angular 2项目的index.html文件,我可以看到该页面只包含来自dist文件夹的3个文件:

inline.bundle.js
vendor.bundle.js
main.bundle.js
Run Code Online (Sandbox Code Playgroud)

但现在我试图了解每个文件的作用.我使用angular-cli编写了组件,我已降级,所以我可以在另一个用angular 1编写的应用程序中使用它.如果我只是将这3个文件添加到我的index.html,再加上app.module.ts文件,似乎我已升级我的应用程序,一切正常.我试图解开为什么,因为谷歌角度不是在谈论角度cli以及它如何帮助迁移.

components angular-cli angular

23
推荐指数
1
解决办法
1万
查看次数

如何在 Spring Boot 应用程序中正确使用 log4j2

我只想在我的应用程序中包含 log4j2 用于日志记录目的。所以我在我的项目的 pom.xml 中包含了以下依赖项:

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-log4j2</artifactId>
        </dependency>
Run Code Online (Sandbox Code Playgroud)

但是在应用程序开始时,我收到以下异常:

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/m2repo/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/m2repo/org/apache/logging/log4j/log4j-slf4j-impl/2.12.1/log4j-slf4j-impl-2.12.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
Run Code Online (Sandbox Code Playgroud)

在许多平台上研究更多关于它的信息时,我发现了一种排除 logback 依赖的方法,因为我认为我需要使用 log4j2。但是在排除那个 jar 之后,我也收到以下错误:

Exception in thread "main" java.lang.ExceptionInInitializerError
Caused by: org.apache.logging.log4j.LoggingException: log4j-slf4j-impl cannot be present with log4j-to-slf4j
Run Code Online (Sandbox Code Playgroud)

所以为了解决这个问题:我也排除了 log4j-to-slf4j 依赖项。

最后它开始工作,但现在我看到大量与 Spring boot Internal 相关的日志消息。例如 :

2019-12-05 12:05:01.649 [DEBUG]  [restartedMain] - Included patterns for restart : [] …
Run Code Online (Sandbox Code Playgroud)

java logging slf4j log4j2 spring-boot

5
推荐指数
1
解决办法
4389
查看次数

标签 统计

angular ×1

angular-cli ×1

components ×1

java ×1

log4j2 ×1

logging ×1

slf4j ×1

spring-boot ×1