DX Application Performance Management

Expand all | Collapse all

How can I configure the EPA logging?

Jump to Best Answer
  • 1.  How can I configure the EPA logging?

    Posted 05-30-2018 12:11 AM

    I'm using:
    System.err.println ("[INFO] File was updated");
    To show the behavior of EPA. But in the IntroscopeEPA.log file not appear. What can i do?



  • 2.  Re: How can I configure the EPA logging?

    Broadcom Employee
    Posted 05-30-2018 12:35 AM

    Hi Martin,

    Sorry not quite with you.

    Where are you executing the code "System.err.println ("[INFO] File was updated");" ?

    Thanks

    Lynn



  • 3.  Re: How can I configure the EPA logging?

    Posted 05-30-2018 12:42 AM

    Hi Lynn,

    I developed the Java plugin and use these lines to run the class:

    introscope.epagent.plugins.stateful.names=CountLog

    introscope.epagent.stateful.CountLog.class=com.tdi.CountLog "../Conf.xml"



  • 4.  Re: How can I configure the EPA logging?

    Broadcom Employee
    Posted 05-30-2018 01:22 AM

    Thanks Martin. Hiko_Davis should be able to advise on that when he comes online.



  • 5.  Re: How can I configure the EPA logging?
    Best Answer

    Broadcom Employee
    Posted 05-30-2018 04:45 AM

    Hi Martin,
    I ran some tests using 10.7 Windows EPAgent running as a service
    I created a simple java program to use System.err.println:


    public class CountLog {
    public static void main(String args[]){
    System.err.println("[INFO] File was updated");
    }
    }

     

    After compile I added the class directory to my EPAgent service classpath.

     

    I also have these properties set in IntroscopeEPAgent.properties

    log4j.logger.EPAgent=DEBUG, console, logfile
    introscope.epagent.plugins.stateful.names=CountLog,CountLogCMD
    introscope.epagent.stateful.CountLog.class=CountLog
    introscope.epagent.stateful.CountLog.delayInSeconds=5
    introscope.epagent.stateful.CountLogCMD.command=CountLog.cmd
    introscope.epagent.stateful.CountLogCMD.delayInSeconds=5

    I am seeing the expected output "[INFO] File was updated" from both plugins in the wrapper log for my EPAgent service (EPAgentService.log)
    ===
    2018/05/30 13:53:11 | INFO | 5/30/18 01:53:11 PM IST [ERROR] [EPAgent] The stateful plugin 'CountLog' is being restarted.
    2018/05/30 13:53:11 | INFO | [INFO] File was updated
    2018/05/30 13:53:11 | INFO | 5/30/18 01:53:11 PM IST [DEBUG] [EPAgent] Class plugin finished: CountLog
    2018/05/30 13:53:11 | INFO | 5/30/18 01:53:11 PM IST [ERROR] [EPAgent.EPAgent CountLog] The stateful plugin 'CountLog' has unexpectedly quit.
    2018/05/30 13:53:11 | INFO | 5/30/18 01:53:11 PM IST [ERROR] [EPAgent] The stateful plugin 'CountLogCMD' is being restarted.
    2018/05/30 13:53:11 | INFO | 5/30/18 01:53:11 PM IST [DEBUG] [EPAgent.EPAgent CountLogCMD] Starting plugin process: CountLog.cmd
    2018/05/30 13:53:11 | INFO | 5/30/18 01:53:11 PM IST [DEBUG] [EPAgent] Process plugin parsing line: C:\epagent_10_7\bin>java CountLog
    2018/05/30 13:53:11 | INFO | 5/30/18 01:53:11 PM IST [ERROR] [EPAgent.EPAPluginProcessor] Metric data from plugin 'Plugin CountLogCMD' is invalid: C:\epagent_10_7\bin>java CountLog
    2018/05/30 13:53:11 | INFO | 5/30/18 01:53:11 PM IST [DEBUG] [EPAgent.EPAgent CountLogCMD] Process has exited with: 0
    2018/05/30 13:53:11 | INFO | 5/30/18 01:53:11 PM IST [ERROR] [EPAgent.EPAgent CountLogCMD] [ stderr ] [INFO] File was updated
    2018/05/30 13:53:11 | INFO | 5/30/18 01:53:11 PM IST [INFO] [EPAgent.EPAgent CountLogCMD] The process started by plugin CountLogCMD was destroyed
    2018/05/30 13:53:11 | INFO | 5/30/18 01:53:11 PM IST [ERROR] [EPAgent.EPAgent CountLogCMD] The stateful plugin 'CountLogCMD' has unexpectedly quit.
    ===


    However the IntroscopeEPA.log file only contains the "[INFO] File was updated" from the command plugin
    ===
    5/30/18 01:53:11 PM IST [ERROR] [EPAgent] The stateful plugin 'CountLog' is being restarted.
    5/30/18 01:53:11 PM IST [DEBUG] [EPAgent] Class plugin finished: CountLog
    5/30/18 01:53:11 PM IST [ERROR] [EPAgent.EPAgent CountLog] The stateful plugin 'CountLog' has unexpectedly quit.
    5/30/18 01:53:11 PM IST [ERROR] [EPAgent] The stateful plugin 'CountLogCMD' is being restarted.
    5/30/18 01:53:11 PM IST [DEBUG] [EPAgent.EPAgent CountLogCMD] Starting plugin process: CountLog.cmd
    5/30/18 01:53:11 PM IST [DEBUG] [EPAgent] Process plugin parsing line: C:\epagent_10_7\bin>java CountLog
    5/30/18 01:53:11 PM IST [ERROR] [EPAgent.EPAPluginProcessor] Metric data from plugin 'Plugin CountLogCMD' is invalid: C:\epagent_10_7\bin>java CountLog
    5/30/18 01:53:11 PM IST [DEBUG] [EPAgent.EPAgent CountLogCMD] Process has exited with: 0
    5/30/18 01:53:11 PM IST [ERROR] [EPAgent.EPAgent CountLogCMD] [ stderr ] [INFO] File was updated
    5/30/18 01:53:11 PM IST [INFO] [EPAgent.EPAgent CountLogCMD] The process started by plugin CountLogCMD was destroyed
    5/30/18 01:53:11 PM IST [ERROR] [EPAgent.EPAgent CountLogCMD] The stateful plugin 'CountLogCMD' has unexpectedly quit.
    ===

     

    So if you are also running EPAgent as a service your class plugin output may also be going to the service log file.
    Are you running as a service on Linux/Unix or Windows?
    What version of EPAgent are you running?

     

    Thanks

     

    Lynn



  • 6.  Re: How can I configure the EPA logging?

    Broadcom Employee
    Posted 05-30-2018 10:46 AM

    This is likely because you're only capturing STOUT & STDERR from the console output.

     

    My suggestion is to implement your own logger using Apache Log4J, like EPA uses.



  • 7.  Re: How can I configure the EPA logging?

    Broadcom Employee
    Posted 05-30-2018 08:25 PM

    Martin,

    To clarify further, as well as IntroscopeEPAgent.properties having "log4j.logger.EPAgent=DEBUG, console, logfile"

    I also had DEBUG set in the wrapper conf file EPAService.conf i.e.

    #wrapper.logfile.loglevel=STATUS
    wrapper.logfile.loglevel=DEBUG

    When I reverted to STATUS I saw no output in the  file.

     

    I have tested starting EPAgent from command line like this:

    java -Dcom.wily.introscope.epagent.properties=C:/epagent_10_7/IntroscopeEPAgent.properties -jar C:/epagent_10_7/lib/EPAgent.jar > epagent_stdout.out 2> epagent_stderr.out

     

    Only the class plugin output is written to epagent_stderr.out

    ===

    2018-05-31 05:26:38.218:INFO:oejs.Server:jetty-7.x.y-SNAPSHOT
    2018-05-31 05:26:38.258:INFO:oejsh.ContextHandler:started o.e.j.s.ServletContextHandler{/,null}
    2018-05-31 05:26:38.350:INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:9080
    [INFO] File was updated
    [INFO] File was updated

    ===

     

    The command plugin output appears in epagent_stdout.out (console) and IntroscopeEPA.log (logfile):

    ===

    5/31/18 05:30:08 AM IST [ERROR] [EPAgent] The stateful plugin 'CountLog' is being restarted.
    5/31/18 05:30:08 AM IST [DEBUG] [EPAgent] Class plugin finished: CountLog
    5/31/18 05:30:08 AM IST [ERROR] [EPAgent.EPAgent CountLog] The stateful plugin 'CountLog' has unexpectedly quit.
    5/31/18 05:30:08 AM IST [ERROR] [EPAgent] The stateful plugin 'CountLogCMD' is being restarted.
    5/31/18 05:30:08 AM IST [DEBUG] [EPAgent.EPAgent CountLogCMD] Starting plugin process: CountLog.cmd
    5/31/18 05:30:08 AM IST [DEBUG] [EPAgent] Process plugin parsing line: C:\epagent_10_7>java CountLog
    5/31/18 05:30:08 AM IST [ERROR] [EPAgent.EPAPluginProcessor] Metric data from plugin 'Plugin CountLogCMD' is invalid: C:\epagent_10_7>java CountLog
    5/31/18 05:30:08 AM IST [DEBUG] [EPAgent.EPAgent CountLogCMD] Process has exited with: 0
    5/31/18 05:30:08 AM IST [ERROR] [EPAgent.EPAgent CountLogCMD] [ stderr ] [INFO] File was updated
    5/31/18 05:30:08 AM IST [INFO] [EPAgent.EPAgent CountLogCMD] The process started by plugin CountLogCMD was destroyed
    5/31/18 05:30:08 AM IST [ERROR] [EPAgent.EPAgent CountLogCMD] The stateful plugin 'CountLogCMD' has unexpectedly quit.

    ===

     

    I think that all maps to what Hiko_Davis was describing.

     

    Regards,

     

    Lynn