JSON log file format

59 views
Skip to first unread message

Bryan Wooten

unread,
Aug 26, 2020, 11:50:13 AM8/26/20
to cas-...@apereo.org
I know this is more of a log4j question, but my google foo is not working.

My log4j2.xml has this:

<RollingFile name="auditlogfile" fileName="/etc/cas/logs/cas_audit.log" append="true"
                     filePattern="/etc/cas/logs/cas_audit-%d{yyyy-MM-dd-HH}-%i.log">
            <PatternLayout pattern="%d %p [%c] - %m%n"/>
            <Policies>
                <OnStartupTriggeringPolicy />
                <SizeBasedTriggeringPolicy size="20 MB"/>
                <TimeBasedTriggeringPolicy />
            </Policies>
        </RollingFile>

Does anyone have an example showing a JSON PatternLayout?

-Bryan

University of Utah

Jason Everling

unread,
Aug 26, 2020, 12:16:43 PM8/26/20
to cas-...@apereo.org

We are using JSON format so that its more Filebeat friendly, did you also configure in your cas.properties? We didn’t have to change anything in the log4j xml besides enabling the audit file, the properties are below which comes from https://apereo.github.io/cas/6.2.x/configuration/Configuration-Properties.html#slf4j-audits

 

cas.audit.slf4j.auditFormat=JSON

cas.audit.slf4j.singlelineSeparator=|

cas.audit.slf4j.useSingleLine=true

cas.audit.slf4j.enabled=true

--
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
---
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 cas-user+u...@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/CAG9x2GVhAMkkTZNho63hxcmOv97bRjJ-rUAM7OmUi94E_kEm-w%40mail.gmail.com.

 

Bryan Wooten

unread,
Aug 26, 2020, 2:25:54 PM8/26/20
to cas-...@apereo.org
Thanks for the tip. I should have been more clear. We are on 6.1.7 so I think this is what we want:


Reply all
Reply to author
Forward
0 new messages