Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
1 reply Latest Post - ‏2012-10-03T21:52:21Z by nilsbru
nilsbru
nilsbru
2 Posts
ACCEPTED ANSWER

Pinned topic startDaemon handler in groovy

‏2012-10-03T16:22:09Z |
I created a startDaemon event handler in groovy. The event handler is supposed to write output to the error.log, but when I start the application, I don't see the expected output in error.log. I did see error.log output for another startDaemon handler in the application which was written in Java. Is the process for creating a startDaemon event handler different in groovy than in java?

Added to events.config:
/config/handlers += [{
"events" : "startDaemon",
"handler" : "startTest.groovy"
}]

Added to startTest.groovy:
def onStartDaemon() {
logger.INFO { "onStartDaemon" };
}

I did not add the onStartDaemon() method to the startTestBindings.java file. Is this necessary for sMash to find the method at startup?
Updated on 2012-10-03T21:52:21Z at 2012-10-03T21:52:21Z by nilsbru
  • nilsbru
    nilsbru
    2 Posts
    ACCEPTED ANSWER

    Re: startDaemon handler in groovy

    ‏2012-10-03T21:52:21Z  in response to nilsbru
    User Error: I did not see the INFO level messages in the log because the trace level for the package was set to OFF. Once I changed the trace spec, I saw the desired messages in the log, so I can confirm that my code ran at startup.