Not sure if this is part of the problem or not but by default the email
appender will only email stuff of level ERROR. Also check your SMTP
host...doesn't seem like that should be localhost (unless you stuck that in
there for the listserv). Also we have our bufferSize set to 1...I believe
the way you have it currently configured it won't send an email until it has
detected 16 errors and then it will mail them all to you at once.

Curtis

On Tue, Oct 19, 2010 at 2:04 AM, Duana Stanley <[email protected]> wrote:

> Hi. We want to add an email Log4j appender so that we are notified of
> errors via email.
>
> It seems to be picking up our log4j.properties.  Email appender works for
> our custom code but not for spring or cas classes.
>
> We can see the spring and cas classes logging stuff to the file but they
> don't get emailed.  Your help appreciated. log4j.properties and web.xml
> snippets below.
>
> Thanks,
> Duana
>
> # TEST log4j
> log4j.rootLogger=DEBUG, LOGFILE, EMAIL
>
> log4j.appender.LOGFILE=org.apache.log4j.RollingFileAppender
> log4j.appender.LOGFILE.MaxBackupIndex=10
> log4j.appender.LOGFILE.MaxFileSize=10MB
> log4j.appender.LOGFILE.File=cas.log
> log4j.appender.LOGFILE.Append=true
> log4j.appender.LOGFILE.Threshold=DEBUG
> log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
> log4j.appender.LOGFILE.layout.ConversionPattern=%d %-4r [%t] %-5p %c %x -
> %m%n
>
> log4j.appender.EMAIL=org.apache.log4j.net.SMTPAppender
> log4j.appender.EMAIL.SMTPHost=localhost
> [email protected]
> [email protected]
> log4j.appender.EMAIL.subject=[Test]: CAS Application Error
> log4j.appender.EMAIL.bufferSize=16
> log4j.appender.EMAIL.Threshold=WARN
> log4j.appender.EMAIL.layout=org.apache.log4j.PatternLayout
> log4j.appender.EMAIL.layout.ConversionPattern=%d %-4r [%t] %-5p %c %x -
> %m%n
>
> # WARNING: Setting the flow package to DEBUG will display
> # the parameters posted to the login servlet including
> # cleartext authentication credentials
> log4j.logger.org.jasig=INFO, EMAIL
> log4j.logger.org.jasig.cas.web.flow=INFO
> log4j.logger.org.jasig.cas.authentication=INFO
> log4j.logger.org.jasig.cas.web.flow.TicketGrantingTicketCheckAction=INFO
> log4j.logger.org.jasig.cas.services.DefaultServiceRegistry=INFO
> log4j.logger.org.jasig.cas.services=INFO
>
>
>
>        <context-param>
>                <param-name>log4jConfigLocation</param-name>
>                <param-value>/WEB-INF/log4j.properties</param-value>
>        </context-param>
>
>    <context-param>
>                <param-name>log4jExposeWebAppRoot</param-name>
>                <param-value>false</param-value>
>        </context-param>
>
>    <listener>
>
>  
> <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
>  </listener>
> --
> 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
>



-- 
Curtis Garman

-- 
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