How to change logging location

31 views
Skip to first unread message

Zach Tackett

unread,
Nov 14, 2018, 9:19:12 AM11/14/18
to CAS Community
Currently, the cas, cas_audit, and perfStats logs are saving to the root cas directory. Where can that be changed?

Paul Chauvet

unread,
Nov 14, 2018, 11:50:37 AM11/14/18
to cas-...@apereo.org

 

Assuming you are using CAS 5.x the following should work.  This is how I have things set (relevant parts in bold).  This is a portion of the log4j2.xml file in /etc/cas/config

 

 

<Configuration monitorInterval="5" packages="org.apereo.cas.logging">

    <Properties>

        <!--

        Default log directory is the current directory but that can be overridden with -Dcas.log.dir=<logdir>

        Or you can change this property to a new default

        -->

        <Property name="cas.log.dir" >/var/log/cas</Property>

        <!-- To see more CAS specific logging, adjust this property to info or debug or run server with -Dcas.log.level=debug -->

        <Property name="cas.log.level" >warn</Property>

    </Properties>

    <Appenders>

        <Console name="console" target="SYSTEM_OUT">

            <PatternLayout pattern="%d %p [%c] - &lt;%m&gt;%n"/>

        </Console>

        <RollingFile name="file" fileName="${sys:cas.log.dir}/cas.log" append="true"

                     filePattern="${sys:cas.log.dir}/cas-%d{yyyy-MM-dd}.log">

            <PatternLayout pattern="%d %p [%c] - &lt;%m&gt;%n"/>

            <Policies>

                <OnStartupTriggeringPolicy />

                <TimeBasedTriggeringPolicy interval="1" modulate="true"/>

            </Policies>

        </RollingFile>

        <RollingFile name="auditlogfile" fileName="${sys:cas.log.dir}/cas_audit.log" append="true"

                     filePattern="${sys:cas.log.dir}/cas_audit-%d{yyyy-MM-dd}.log">

            <PatternLayout pattern="%d %p [%c] - %m%n"/>

            <Policies>

                <OnStartupTriggeringPolicy />

                <TimeBasedTriggeringPolicy interval="1" modulate="true"/>

            </Policies>

        </RollingFile>

 

        <RollingFile name="perfFileAppender" fileName="${sys:cas.log.dir}/perfStats.log" append="true"

                     filePattern="${sys:cas.log.dir}/perfStats-%d{yyyy-MM-dd}.log">

            <PatternLayout pattern="%m%n"/>

            <Policies>

                <OnStartupTriggeringPolicy />

                <TimeBasedTriggeringPolicy interval="1" modulate="true"/>

            </Policies>

        </RollingFile>

 

Paul Chauvet, CISSP

Information Security Officer

State University of New York at New Paltz

845-257-3828

chau...@newpaltz.edu

emlogo

--
- 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/ab5f4e12-3f0f-49ba-a7ef-f20dc36811f5%40apereo.org.

Reply all
Reply to author
Forward
0 new messages