• 1 reply
  • Latest Post - ‏2012-10-03T21:52:21Z by nilsbru
2 Posts

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

    Re: startDaemon handler in groovy

    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.