about backend

19 views
Skip to first unread message

Manas Marthi

unread,
Nov 29, 2023, 2:02:49 PM11/29/23
to Flogger Discuss
Hi

what is the default backend used by flogger? log4j2? 

 what logging provider is used by each of the below backends? i

mplementation 'com.google.flogger:flogger-system-backend:0.8' 

 implementation 'com.google.flogger:flogger-slf4j-backend:0.8' 

implementation 'com.google.flogger:flogger-log4j-backend:0.8'


thanks

Manas Marthi

unread,
Nov 30, 2023, 2:00:06 AM11/30/23
to Flogger Discuss
When I tried log4j2 backend [https://hagbard.github.io/the-flogger-manual/install/], I got below error. 
But when I use system backend it works

ApplicationTests > contextLoads() FAILED
    java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:180
        Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException at ConstructorResolver.java:802
            Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException at ConstructorResolver.java:802
                Caused by: org.springframework.beans.factory.BeanCreationException at ConstructorResolver.java:322
                    Caused by: org.springframework.beans.BeanInstantiationException at BeanUtils.java:223
                        Caused by: java.lang.ClassCastException at Log4j2BackendFactory.java:56


My current deps
//implementation 'com.google.flogger:flogger-log4j2-backend:0.8'
implementation 'com.google.flogger:flogger-system-backend:0.8'

thanks
Manas

Manas Marthi

unread,
Nov 30, 2023, 3:22:19 AM11/30/23
to Flogger Discuss
I had to add below to force log4j2.  and added log4j2.xml. However, appenders are not working properly

configurations.all {
exclude group: 'ch.qos.logback', module: 'logback-classic'
exclude group: 'ch.qos.logback', module: 'logback-core'
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
exclude group: 'org.apache.logging.log4j', module: 'log4j-jul'
}

Manas Marthi

unread,
Dec 1, 2023, 4:29:51 AM12/1/23
to Flogger Discuss

can someone pls advise if there is a simpler setup than this?

configurations.all {
exclude group: 'ch.qos.logback', module: 'logback-classic'
exclude group: 'ch.qos.logback', module: 'logback-core'
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
exclude group: 'org.apache.logging.log4j', module: 'log4j-jul'
}
implementation "org.springframework.boot:spring-boot-starter-log4j2"
implementation 'com.google.flogger:flogger:0.8'
implementation 'com.google.flogger:flogger-log4j2-backend:0.8'

thank you

On Wednesday, November 29, 2023 at 7:02:49 PM UTC Manas Marthi wrote:
Reply all
Reply to author
Forward
0 new messages