[ 
https://issues.apache.org/jira/browse/LOG4J2-3405?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17493880#comment-17493880
 ] 

member sound commented on LOG4J2-3405:
--------------------------------------

Okay, then this is probably  just a docs issue, because 
[https://logging.apache.org/log4j/2.x/manual/lookups.html] does not state in 
any way that `log4j-spring-boot` can be used for Spring Lookup.

> LookupSupport Spring Boot without Cloud BusBridge
> -------------------------------------------------
>
>                 Key: LOG4J2-3405
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-3405
>             Project: Log4j 2
>          Issue Type: New Feature
>          Components: Boot
>    Affects Versions: 2.17.1
>            Reporter: member sound
>            Priority: Major
>
> It would be great if Support Spring Boot 
> [https://logging.apache.org/log4j/2.x/manual/lookups.html|https://logging.apache.org/log4j/2.x/manual/lookups.html)]
>  like
> ${spring:spring.application.name}
> could be supported without requiring a cloud bus spring configuration. Thus 
> being usable in normal projects.
>  
> What happens in non-cloud projects, if you include the 
> `log4j-spring-cloud-config-client` dependency, is the following error:
> {{{{}}{}}}{{{}***************************{}}}
> {{APPLICATION FAILED TO START}}
> {{{}***************************{}}}{{{}Description:{}}}{{{}Parameter 1 of 
> method busRemoteApplicationEventListener in 
> org.springframework.cloud.bus.BusAutoConfiguration required a bean of type 
> 'org.springframework.cloud.bus.BusBridge' that could not be found.{}}}
> {{}}
> It would be great having the ability to inject `application.properties` 
> parameters from Spring in general.
>  
> I tried excluding the cloud dependency as follows:
> <{color:#000080}dependency{color}>
>    
> <{color:#000080}groupId{color}>org.apache.logging.log4j</{color:#000080}groupId{color}>
>    
> <{color:#000080}artifactId{color}>log4j-spring-cloud-config-client</{color:#000080}artifactId{color}>
>    <{color:#000080}version{color}>2.17.1</{color:#000080}version{color}>
>   <{color:#000080}exclusions{color}>
>   <{color:#000080}exclusion{color}>
>    
> <{color:#000080}groupId{color}>org.springframework.cloud</{color:#000080}groupId{color}>
>    
> <{color:#000080}artifactId{color}>spring-cloud-bus</{color:#000080}artifactId{color}>
>   </{color:#000080}exclusion{color}>
>  </{color:#000080}exclusions{color}>
> </{color:#000080}dependency{color}>
>  
> {color:#000080}spring.cloud.config.enabled{color}={color:#000080}false{color}
> {color:#000080}spring.cloud.compatibility-verifier.enabled{color}={color:#000080}false{color}
> {color:#000080}spring.application.name{color}={color:#008000}foo{color}
>  
> <{color:#000080}RollingRandomAccessFile 
> {color}{color:#0000ff}name{color}{color:#008000}="APP" 
> {color}{color:#0000ff}fileName{color}{color:#008000}="${path}/${spring:spring.application.name}.logs"{color}{color:#008000}
>  
> {color}{color:#0000ff}filePattern{color}{color:#008000}="${path}/archive/${spring:spring.application.name}.log.gz"{color}>
>  
> This works to some degree. BUT log4j creates 2 files in this process:
> a) ${spring:spring.application.name}.logs
> b) foo.logs
>  
> Somehow the property is resolved a bit too late at some stage.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to