I noticed an issue with one of the CAS log files --
/var/log/cas/cas.log.  It may not be exactly a CAS issue, but some
initial searching didn't yield any fruitful results, so I thought I'd
seek help here.  Basically, CAS (or more precisely, Tomcat) has
multiple (two) copies of the log file open, and is writing to both of
them, one, then the other, back and forth.

I noticed this as I was trying to set up the Inspektr auditing to go
to its own file.  I've got mostly a base install, although I did
customize the log4j.xml file a bit.  It's got the following:

    <appender name="cas" class="org.apache.log4j.RollingFileAppender">
        <param name="File" value="/var/log/cas/cas.log" />
        <param name="MaxFileSize" value="512KB" />
        <param name="MaxBackupIndex" value="3" />
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%d %p [%c] - %m%n"/>
        </layout>
    </appender>

And then later:

    <logger 
name="com.github.inspektr.audit.support.Slf4jLoggingAuditTrailManager">
        <level value="INFO" />
        <appender-ref ref="cas" />
    </logger>

I presume to set up this auditing to go to its own file, I can just
define another appender and use that in the Inspektr appender-ref.

Anyway, before I did that, I checked /var/log/cas/cas.log to see what
was going in there.  "ls -l /var/log/cas" shows the following:

-rw-rw-r-- 1 root root 416374 Jan 21 11:32 cas.log
-rw-rw-r-- 1 root root 426090 Jan 21 11:33 cas.log.1
-rw-rw-r-- 1 root root 524461 Jan 20 03:57 cas.log.2
-rw-rw-r-- 1 root root 524453 Jan 20 03:28 cas.log.3

Notice the timestamps on the files -- cas.log and cas.log.1 both have
very similar timestamps, as do cas.log.2 and cas.log.3.  And looking
at the timestamps on the lines in the log files, both files (cas.log
and cas.log.1) are being written to, some lines to one file, then some
to the other.  So if I were to cat them together and sort by the
timestamps on the lines, I'd have the one true log file I'm supposed
to be getting.

If I do "lsof | grep var.log.cas", I see over 100 lines of output,
paired up like the following:

java      26111              root   52w      REG              202,1   418569  
418833 /var/log/cas/cas.log
java      26111              root   66u      REG              202,1   428284  
418653 /var/log/cas/cas.log.1

All the other lines have the same PID but different TIDs -- and 26111
is the CAS Tomcat process.  So it looks like Tomcat does have both log
files open.

So what's going on here?  Shouldn't there be only one log file open?
It looks like log4j is set up to do log rotation, is that not working
right?  (BTW, is it possible to set it up to compress/gzip older logs,
as logrotate does?)

And another log question.  There are tons of lines like the following
in there:

2015-01-20 03:57:51,570 WARN [org.ldaptive.pool.BlockingConnectionPool] - 
connection failed validation: 
org.ldaptive.pool.AbstractConnectionPool$DefaultPooledConnectionProxy@6b78ada4

Is this a problem?  Is it normal?  Is there some configuration I can
change to eliminate them?

Any help appreciated.

Milt Epstein
Applications Developer
Graduate School of Library and Information Science (GSLIS)
University of Illinois at Urbana-Champaign (UIUC)
[email protected]

-- 
You are currently subscribed to [email protected] as: 
[email protected]
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-user

Reply via email to