Matthew,

Add this to cas.properties (you will get used to the format after a while):

cas.audit.useSingleLine=true

Or you can use 'replace' in your logger which has the added benefit of handling 
java stack traces:

        <Socket name="syslogAppender" host="localhost" port="1514" 
protocol="TCP">
            <PatternLayout>
                <pattern>&lt;%level{WARN=28, DEBUG=31, ERROR=27, TRACE=31, 
INFO=30, FATAL=25}&gt;%d{MMM dd HH:mm:ss} ${hostName} CAS: %c 
%replace{%m}{\n+}{&lt;31&gt;CAS: TRACE: }%n</pattern>
            </PatternLayout>
        </Socket>

Ray

On Thu, 2019-02-14 at 07:40 -0800, Matthew Uribe wrote:
Hi all,

We've just recently added the appender and logger to log4j2.xml referred to in 
the documentation to route logs to SysLog (CAS 5.2.x). However, each individual 
line is being sent as a separate log entry. Is there a way to keep all the 
relevant lines for an entry together?

For example, each of the following lines is sent separately:

=============================================================
WHO: user
WHAT: ST...
ACTION: SERVICE_TICKET_CREATED
APPLICATION: CAS
WHEN: Wed Feb 13 00:00:12 MST 2019
CLIENT IP ADDRESS: 1.2.3.4
SERVER IP ADDRESS: 4.3.2.1
=============================================================

Only, they're not sent over in this exact order. Instead, they are all jumbled 
with unrelated entries overlapping each other. I'm using the configuration from 
the "Routing Logs to SysLog" section of this page: 
https://apereo.github.io/cas/5.2.x/installation/Logging.html
The only thing I've really changed so far is the newLine - I set it to false 
thinking it might change this line by line behavior, but it did not. My next 
thought is to change the format, or experiment with other layouts, but rather 
than guess and check, I thought I'd first reach out to the community. Any 
insights would truly be appreciated.


...
<Appenders>
    <Syslog name="SYSLOG" format="RFC5424" host="log.server.example" port="514"
            protocol="TCP" appName="MyApp" includeMDC="true" mdcId="mdc"
            facility="LOCAL0" enterpriseNumber="18060" newLine="false"
            messageId="Audit" id="App"/>
</Appenders>
...
<AsyncLogger name="org.apereo" additivity="true" level="debug">
    <appender-ref ref="SYSLOG" />
</AsyncLogger>



Thanks!
Matt

--
Ray Bon
Programmer analyst
Development Services, University Systems
2507218831 | CLE 019 | [email protected]

-- 
- 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/1550161102.3634.60.camel%40uvic.ca.

Reply via email to