Lift and Configgy
Robey wrote Configgy, and summarizes it as:
Configgy is a library for handling config files and logging for a scala daemon. The idea is that it should be simple and straightforward, allowing you to plug it in and get started quickly, writing small useful daemons without entering the shadowy world of java frameworks.
Simple and straight forward indeed. To add it to my Lift app I did the following:
1. Added this to my pom.xml
<repository>
<id>http://www.lag.net/repo/</id>
<name>http://www.lag.net/repo/</name>
<url>http://www.lag.net/repo/</url>
</repository>
And
<dependency>
<groupid>net.lag</groupid>
<artifactid>configgy</artifactid>
<version>1.2</version>
</dependency>
2. Wrote this conf file (it’s in the same dir as the pom.xml file and so is the log directory which you’ll need permissions on)
<log>
filename = "log/pca.log"
roll = "daily"
level = "debug"
</log>
hostname = "localhost"
port = 8080
3. Added this to Boot.scala
...
import net.lag.configgy.Configgy
import net.lag.logging.Logger
...
Configgy.configure("pca.conf")
val log = Logger.get
log.info("Configgy up")
log.info("Bootstrap up")
4. And a quick test, in one of my snippets I added:
...
import net.lag.logging.Logger
...
log.info("Super Awesome Form rendered")
5. The output is:
INF [20081119-14:11:15.085] liftweb: Configgy up
INF [20081119-14:11:15.088] liftweb: Bootstrap up
INF [20081119-14:11:22.144] snippet: Super Awesome Form rendered
Make with the nice nice.