LogDigger Connector for Grails

The LogDigger connector for the Grails web application framework (http://grails.org) is a simple wrapper around the Java connector, packaged as a Grails plugin.

Installation

The plugin is available from the Grails plugin repository, so you can install it with:

grails install-plugin logdigger-connector

The plugin adds a servlet filter that installs a Log4j appender and communicates with clients.

Configuration

The LogDigger connector can be configured using the logdigger scope in Config.groovy.

grails-app/conf/Conf.groovy

logdigger {

    // Name of Spring bean implementing RequestAuthorizer interface.
    authorizer = 'myLogdiggerAuthorizer'

    // Grails Connector will by default run in LDCLIENT mode.
    // Switching to the REQLOG mode you disable log uploads by server.
    //mode = 'REQLOG'

    // URL to LogDigger Server.
    serverUrl = 'http://servername/logdigger/'

    // Project's logging key at LogDigger Server.
    projectKey = 'your_project_logging_key'
}

Authorizer bean should be defined in resources.groovy. The following example shows a sample configuration using Simple Authorizer.

grails-app/conf/spring/resources.groovy

 beans = {
     myLogdiggerAuthorizer(com.logdigger.connector.impl.SimpleAuthorizer) {
         //hasSessionAttribute = ''
         //remoteHost = ''
         remoteIP = '192.168.2.[1-9]*'
         //serverName = 'localhost'
     }
}

No special configuration is need to make the Grails connector work with the App Engine. The LogDigger servlet filter will detect that it is running in the GAE/J environment and auto-configure.

Except where otherwise noted, content in this space is licensed under a Creative Commons Attribution 2.5