logging

11 views
Skip to first unread message

Alex Tkachman

unread,
Jun 21, 2011, 2:56:29 AM6/21/11
to gre...@googlegroups.com
Hi All!

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

"이희승 (Trustin Lee)"

unread,
Jun 21, 2011, 5:32:29 AM6/21/11
to gre...@googlegroups.com
I think it's OK as long as you do not expose Netty's logging classes to a user. It's strictly intended for internal uses as documented.

Stat monitoring sounds cool. I'm actually thinking about providing such functionality as a set of handler types in Netty 4.

Alex Tkachman

unread,
Jun 21, 2011, 5:45:06 AM6/21/11
to gre...@googlegroups.com

"이희승 (Trustin Lee)"

unread,
Jun 21, 2011, 5:49:16 AM6/21/11
to gre...@googlegroups.com
It looks OK. :-)
Reply all
Reply to author
Forward
0 new messages