If you use <gel:out> in your script for debugging you will find yourself reworking them into <gel:log> statements before moving it to your target process.
In order to get your <gel:log> messages to your console screen you just need two things:
- Add a log4j.logger.com.niku.union.gel=info property to a log4j.properties file.
- Edit the gel.bat file (save a copy to revert to if needed) and add a –D argument pointing to the log4j.properties file:
-Dlog4j.configuration="file:\%NIKU_HOME%\lib\log4j.properties"
So in my case, I placed the log4j.properties file inside the lib folder.
So my log4.properties file looks like this: (I also have a RunGel.log file created for large gel script runs)
### set log levels - for more verbose logging change 'info' to 'debug' ###
### Also add logfile to the root, if need stdout then add stdout appender here###
log4j.rootLogger=info, R
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=RunGel.log
log4j.appender.R.MaxFileSize=100KB
log4j.appender.R.MaxBackupIndex=1
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
log4j.logger.com.niku.union.gel=info
And the java command in the gel.bat looks like this:
Java -Xms32m -Xmx512m -cp "%CLASSPATH%" -Dniku.home="%NIKU_HOME%" -Dlog4j.configuration="file:\%NIKU_HOME%\lib\log4j.properties" -Dforehead.conf.file="%NIKU_HOME%\bin\gel.forehead" com.werken.forehead.Forehead -installDir "%NIKU_HOME%" %GEL_ARGS%
You should now see all you log messages along with their levels on your console screen.
V/r,
Gene