AutoSys Workload Automation

  • 1.  Log4j Configuration

    Posted Mar 18, 2014 04:28 PM

    I'm trying to configure Log4j to send an email when an error is detected in the JobControlServer logs. Currently, I have it set to Rollfile (which works fine) and have added the SMTP appenders. But whenever I stop the JSC service and restart, it fails to restart. I can't find anything on this site or the documentation to help. I read through the log4j documentation, but I'm stuck on this one piece.

    I have log4j.debug turned on but I don't know where to find the system.out log for it.

    Here's the parts of the log4j.properties file I have set up in \Workload Control Center\Logs\Application\JobControlServer:

    ---------------------------------------------------------------------------------------------------------------------------------------------------------------

    # do not comment the following line
    log4j.loggerFactory=com.ca.uejm.admin.servlet.logger.CoreLoggerFactory

    log4j.debug=TRUE

    log4j.rootLogger=ERROR,ROLLFILE,SMTP
    log4j.appender.ROLLFILE=org.apache.log4j.RollingFileAppender
    log4j.appender.ROLLFILE.File=E:/Program Files (x86)/CA/Workload Control Center/Logs/application/jobcontrolserver/uejm_jobconsole_server.log
    log4j.appender.ROLLFILE.MaxFileSize=200KB
    log4j.appender.ROLLFILE.MaxBackupIndex=10
    log4j.appender.ROLLFILE.layout=org.apache.log4j.PatternLayout
    #log4j.appender.ROLLFILE.layout.ConversionPattern=[ <%t> [%x] ] %p %d  %c - MethodName[ %M ]: %m%n
    log4j.appender.ROLLFILE.layout.ConversionPattern=[ <%t> [%x] ] %p %d  %c{2} %m%n

    #added smtp appender
    log4j.appender.SMTP=org.apache.log4j.net.SMTPAppender
    log4j.appender.SMTP.SMTPHost=smtp.me.com
    log4j.appender.SMTP.From=admin@me.com
    log4j.appender.SMTP.To=me@me.com
    log4j.appender.SMTP.Subject=Admin app error log
    log4j.appender.SMTP.BufferSize=1
    log4j.appender.SMTP.EvaluatorClass=TriggerLogEvent
    log4j.appender.SMTP.layout=org.apache.log4j.PatternLayout
    log4j.appender.SMTP.layout.ConversionPattern=%m

    Thanks for any help.



  • 2.  RE: Log4j Configuration

    Posted Mar 19, 2014 12:26 AM

    This is a great question. If anyone has got this working please let us know.

    To get this working I am wondering if it requires that the application imports a java mailer? If so, I doubt we are doing that.

    Also a couple notes on these parameters:

    log4j.appender.SMTP.SMTPProtocol=

    log4j.appender.SMTP.SMTPPort=

    SMTPProtocol defaults to smtp but if your SMTP host requires SSL you may need to specify smtps

    Not sure if SMTPPort is required or not.

    You can also try setting SMTPdebug=true. This may result in some useful info or errors.

    Regards,

    Mark Hanson



  • 3.  RE: Log4j Configuration

    Posted Apr 18, 2014 05:28 PM
    ken.kpmcorp:

    I'm trying to configure Log4j to send an email when an error is detected in the JobControlServer logs. Currently, I have it set to Rollfile (which works fine) and have added the SMTP appenders. But whenever I stop the JSC service and restart, it fails to restart. I can't find anything on this site or the documentation to help. I read through the log4j documentation, but I'm stuck on this one piece.

    I have log4j.debug turned on but I don't know where to find the system.out log for it.

    Here's the parts of the log4j.properties file I have set up in \Workload Control Center\Logs\Application\JobControlServer:

    ---------------------------------------------------------------------------------------------------------------------------------------------------------------

    # do not comment the following line
    log4j.loggerFactory=com.ca.uejm.admin.servlet.logger.CoreLoggerFactory

    log4j.debug=TRUE

    log4j.rootLogger=ERROR,ROLLFILE,SMTP
    log4j.appender.ROLLFILE=org.apache.log4j.RollingFileAppender
    log4j.appender.ROLLFILE.File=E:/Program Files (x86)/CA/Workload Control Center/Logs/application/jobcontrolserver/uejm_jobconsole_server.log
    log4j.appender.ROLLFILE.MaxFileSize=200KB
    log4j.appender.ROLLFILE.MaxBackupIndex=10
    log4j.appender.ROLLFILE.layout=org.apache.log4j.PatternLayout
    #log4j.appender.ROLLFILE.layout.ConversionPattern=[ <%t> [%x] ] %p %d  %c - MethodName[ %M ]: %m%n
    log4j.appender.ROLLFILE.layout.ConversionPattern=[ <%t> [%x] ] %p %d  %c{2} %m%n

    #added smtp appender
    log4j.appender.SMTP=org.apache.log4j.net.SMTPAppender
    log4j.appender.SMTP.SMTPHost=smtp.me.com
    log4j.appender.SMTP.From=admin@me.com
    log4j.appender.SMTP.To=me@me.com
    log4j.appender.SMTP.Subject=Admin app error log
    log4j.appender.SMTP.BufferSize=1
    log4j.appender.SMTP.EvaluatorClass=TriggerLogEvent
    log4j.appender.SMTP.layout=org.apache.log4j.PatternLayout
    log4j.appender.SMTP.layout.ConversionPattern=%m

    Thanks for any help.


    It is a bit deeper than just log4j.properties file changes, which is only loaded/read when the UWCC Tomcats are started. There is a log4j.xml embedded within our libraries that we have not exposed since UEJM r1.0 ... yes, Unicenter Enterprise Job Manager using CleverPath Portal and JBoss. To my knowledge, SMTP e-mail cannot be configured without modifications to the log4j facility we build into our product - meaning, no outside user intervention.