I've started adding basic logging to Gretty. The approach is to reuse
logging capabilities of Netty. So all you need to do is
org.jboss.netty.logging.InternalLoggerFactory.setDefaultFactory(InternalLoggerFactory)
Netty provides implementations for most popular logging frameworks.
Trustin, please correct me if this is wrong approach.
Another feature is ability to have basic performance information
logged periodically. For that you can set GrettyServer.logStatistics
property to true.
Logged statistics looks like below
Jun 21, 2011 9:44:39 AM org.mbte.gretty.httpserver.IoMonitor
INFO: Server Statistic:
Open connections: 4
Total connections: 6866
Http requests: 1372.3255348930213 req/sec
Total http requests: 6863
Bytes In: 109.89325572385522 Kb/sec
Bytes Out: 404.6698472805439 Kb/sec
TotalBytesSent: 2072324
TotalBytesReceived: 562766
Heap Memory: init = 0(0K) used = 37153744(36282K)
committed = 85000192(83008K) max = 129957888(126912K)
Non Heap Memory: init = 24317952(23748K) used =
23903424(23343K) committed = 38797312(37888K) max = 138412032(135168K)
System load: 1.60595703125
Please let me know what do you think
Alex
Stat monitoring sounds cool. I'm actually thinking about providing such functionality as a set of handler types in Netty 4.