Skip to content

A Grails plugin to provide some core functionality and utility classes

License

Notifications You must be signed in to change notification settings

wizpanda/kernel

Repository files navigation

Kernel

GitHub version Release

A simple Grails plugin which provide some core functionality and utility classes for a Grails application.

Usage

Logging

KernelLogging class provides various value to your Grails application in development as well as in production. Following are the benefits:

  1. In development, Hibernate queries are logging with faded color so that you can keep watch on your SQL performance and it doesn't affect your normal logging.
  2. Provides daily rotating logging for production with configurable directory and file name prefix.

Slack Server Notifier

Configure the following config in your application.groovy file:

grails.plugin.kernel.server.slack.notify.enabled = true
grails.plugin.kernel.server.slack.notify.webhookURL = "https://hooks.slack.com/services/xxxxxx/xxxxxxx/jJ5dbjbCnfB8EN5dBugFi3d"

Add ServerSlackNotifier.notifyServerStartup() in Bootstrap.groovy file in the last line of def init closure. This will notify the configured Slack channel on app startup with following info:

image

Add ServerSlackNotifier.notifyServerShutdown() in Bootstrap.groovy file in the last line of def destroy closure. This will notify the configured Slack channel on app shutdown with following info:

image

Compatibility

Grails Version Supported
3 >= v1.0.0
3.3.x >= v2.0.0

Change Log

See Releases for the changes.

Installation

Grails 3+

Add the following to build.gradle file of your Grails 3 application

Under repositories section

maven { url 'https://jitpack.io' }

Under dependencies section

compile "com.wizpanda:kernel:x.x.x"

Installing locally for development

To develop in kernel plugin, you can install this plugin locally and run your app directly. For this, add the following in settings.gradle of your Grails application:

// For inline Kernel plugin development
include ":kernel"
project(":kernel").projectDir = new File("../../kernel")

Then comment the line compile "com.wizpanda.plugins:kernel: from your build.gradle and add the line compile project (':kernel'). That's it.

https://medium.com/wizpanda/another-way-of-adding-local-grails-plugin-to-a-grails-app-using-the-gradle-build-tool-d60ddaf326cb

Release

  1. Change the version in the build.gradle.
  2. Commit, tag & push.