Difference between revisions of "Grails"

From Blue-IT.org Wiki

Line 52: Line 52:
 
= Debug =
 
= Debug =
 
  tail -f /project/stacktrace.log
 
  tail -f /project/stacktrace.log
 +
 +
=Context =
 +
Setting context to "/"
 +
 +
1. web-app/application.properties
 +
app.context=/
 +
 +
2. Config.grooy
 +
production {
 +
    grails.app.context = "/"

Revision as of 12:17, 6 September 2011

Installation

First of all: install sun(oracle)-java 1.6 and remove all openjdk packages (or at least be shure to run update-alternatives --config java).

Ubuntu way

http://www.grails.org/Installation

http://www.grails.org/Download

sudo add-apt-repository ppa:groovy-dev/grails
sudo apt-get update
sudo apt-get install grails

#to add grails 2.0.0 M1
sudo apt-get install grails-2.0.0 

#to add grails 1.2.5
sudo apt-get install grails-1.2.5

#switch between versions
sudo update-alternatives --config grails

That's it !

Manual

http://www.grails.org/Installation

http://www.grails.org/Download

Download an install grails into a directory.

Then edit your ~/.bashrc file or use export to set the variables in the running shell / environment:

export PATH="$PATH:/local/share/grails/bin"
export JAVA_HOME="/usr/lib/jvm/java-6-sun"
export GRAILS_HOME="/local/share/grails"

Logging

web-app/WEB-IF/log4j.properties

log4j.rootLogger=INFO, console

log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss} %-5p %c - %m%n

# debug plugin
#log4j.logger.grails.app.filters='info'
#grails.debug.productionOverride=anything

#log4j.category.org.springframework=DEBUG
#log4j.category.com.opensymphony.webwork=DEBUG
#log4j.category.com.opensymphony.xwork=DEBUG

Debug

tail -f /project/stacktrace.log

Context

Setting context to "/"

1. web-app/application.properties

app.context=/

2. Config.grooy

production {
   grails.app.context = "/"