Hi Ian,

I have encountered the same problem using logback. Have you solved the 
problem?

My current solution is put logback-classic before cas-server-core in the 
class path, so that the logback binding will be used instead of 
cas-server-core.
However, the cas-server won't intercept the log so that's not the expected 
behavior.

Using cas-server with apache log4j2 causes no problem, because its 
configuration is loaded in Logger.
But logback configuration (as you stated) is loaded in StaticLoggerBinder, 
and it won't be loaded since the binder has been overridden by 
cas-server-core.

CAS logger intends to wrap another slf4j implementation, however, it fails 
to integrate logback. I think this is a bug.

Best,
Weipeng

On Saturday, January 16, 2016 at 12:29:17 AM UTC+8, Ian wrote:
>
> Hey Will,
>
> Thanks for taking the time to take a look at this.
>
> I'm using logback-classic-1.13 and logback-core-1.1.3 (the slf4j bindings 
> for logback are in logback-classic). I've stepped through a logging attempt 
> and I can see that a logback logger is provided but since it's 
> initialisation is bypassed it has no appenders attached.
>
> Thanks,
>
> Ian
>
>
> On Friday, January 15, 2016 at 4:10:01 AM UTC-5, Will Martin wrote:
>>
>> Hi Ian: From the code for the impl.StaticLoggerBinder
>>
>> "The binding of LoggerFactory class with an actual instance of 
>> org.slf4j.ILoggerFactory 
>> <http://grepcode.com/file/repo1.maven.org/maven2/org.slf4j/slf4j-api/1.6.1/org/slf4j/ILoggerFactory.java#ILoggerFactory>
>>  
>> is performed using information returned by this class. This class is meant 
>> to provide a dummy StaticLoggerBinder to the slf4j-api module. Real 
>> implementations are found in each SLF4J binding project, e.g. slf4j-nop, 
>> slf4j-log4j12 etc.
>> "
>> My guess would be to include one of the binding projects and from there 
>> see if logback is recognized during initialization. Which logback jar are 
>> you using?
>>
>> Regards,
>> Will
>>
>>
>>
>> On Thursday, January 14, 2016 at 3:13:34 PM UTC-5, Ian wrote:
>>>
>>> Hello,
>>>
>>> I am attempting to get CAS 4.1.3 running with logging through logback 
>>> but am having difficulty.
>>>
>>> As far as I can tell since cas-server-core has included 
>>> org.slf4j.impl.StaticLoggerBinder to intercept and sanitize logs (pull 
>>> request adding feature <https://github.com/Jasig/cas/pull/647>) it will 
>>> override the StaticLoggerBinder built into logback and since logback (in 
>>> logback-classic) is initialized in the overridden StaticLoggerBinder 
>>> <https://github.com/qos-ch/logback/blob/35aa410f7f73f026ce7fb676d39c092d8d964d79/logback-classic/src/main/java/org/slf4j/impl/StaticLoggerBinder.java#L93>
>>>  
>>> the logback loggers created for the application will not be configured 
>>> properly. So while it has been stated 
>>> <https://github.com/Jasig/cas/pull/647#issuecomment-51519516> it should 
>>> be possible to configure a logging backend other than log4j2 it seems that 
>>> this is only true for backends other than logback.
>>>
>>> Has anyone been successful in getting cas+logback working? Is this a bug 
>>> or am I missing something?
>>>
>>> Thank you,
>>>
>>> Ian MacGuigan
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups "CAS 
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/a/apereo.org/group/cas-user/.

Reply via email to