Configuring syslog appender in CAS 4.0.1

56 views
Skip to first unread message

Thatcher Rea

unread,
Apr 13, 2021, 9:50:48 AM4/13/21
to CAS Community
As the title suggests i'm trying to get this working - I found this bit of info in the documentation:


But we're using 4.0.1 of CAS - attempting to apply this directive as is results in numerous errors.

log4j:WARN Element type "Appenders" must be declared.
log4j:WARN Continuable parsing error 27 and column 41
log4j:WARN Element type "Syslog" must be declared.
log4j:WARN Continuable parsing error 173 and column 23
log4j:WARN The content of element type "log4j:configuration" must match "(renderer*,throwableRenderer?,appender*,plugin*,(category|logger)*,root?,(categoryFactory|loggerFactory)?)".
log4j:WARN Unrecognized element Appenders
log4j:ERROR No appender named [SYSLOG] could be found.

If I change "Appenders" to "appender" as declared in other sections of the config I get a stack trace and various problems when starting this in the tomcat container. Any advice would be appreciated.

Ray Bon

unread,
Apr 13, 2021, 11:43:33 AM4/13/21
to cas-...@apereo.org
Thatcher,

Is syslog running and accessible?

This is what we use for syslog:


        <Socket name="syslogAppender" host="localhost" port="1514" protocol="TCP">
<PatternLayout>
<pattern>&lt;%level{TRACE=169, DEBUG=175, INFO=174, WARN=172, ERROR=171, Fatal=168}&gt;%d{yyyy-MM-dd}T%d{HH:mm:ss.SSS} cas_app[%pid]: ${env:NAME}: %-5p %t(%T) %c{10} - %m%n%ex{none}</pattern>
            </PatternLayout>
        </Socket>


        <CasAppender name="syslog">
            <AppenderRef ref="syslogAppender" />
        </CasAppender>

You can ignore the pattern element or modify to suit your needs.

If you are using the old log4j (version 1.2, I think), you may be able to use documentation from that version.

Ray

On Tue, 2021-04-13 at 06:50 -0700, Thatcher Rea wrote:
Notice: This message was sent from outside the University of Victoria email system. Please be cautious with links and sensitive information.
-- 
Ray Bon
Programmer Analyst
Development Services, University Systems

I respectfully acknowledge that my place of work is located within the ancestral, traditional and unceded territory of the Songhees, Esquimalt and WSÁNEĆ Nations.

Thatcher Rea

unread,
Apr 13, 2021, 11:53:33 AM4/13/21
to CAS Community, Ray Bon
Thanks Ray, syslog is running and accessible.
This is using the version 1.2 of log4j - Is the config example you pasted from CAS 4.0.x ?

Many thanks

Ray Bon

unread,
Apr 13, 2021, 12:01:47 PM4/13/21
to thatch...@gmail.com, cas-...@apereo.org
Thatcher,

We are Using cas 6.2. I am not sure what version we started with syslog output.
log4j2 is quite an improvement over 1.2.

You may find it more beneficial to spend the time upgrading cas instead of working with the old log4j.

Ray

Andy Ng

unread,
Apr 13, 2021, 9:28:46 PM4/13/21
to CAS Community, Ray Bon, thatch...@gmail.com
Hi Thatcher,

I also agree with Ray, an upgrade is necessary to bring this feature in. 

In terms of why CAS 4.0.1 vs 4.2.x have this feature different:

the log4j library is at 1.2.17 on CAS 4.0.1

While the log4j library is at 2.5+ at the CAS 4.2.x build:

Therefore, without upgrading your CAS, you will not be able to use this feature. Not only that, maintenance for CAS 4.x is EOL a very long time ago: https://apereo.github.io/cas/developer/Maintenance-Policy.html#eol-schedule. Upgrade to 6.x is highly recommended.

Cheers.
Andy
Reply all
Reply to author
Forward
0 new messages