Logging question.

"Trustin Lee (이희승)" trustin at gmail.com
Wed Mar 24 01:36:48 EDT 2010


infectedrhytms wrote:
> Sorry if my question sounded stupid. But the only way I found out that I can
> even use Log4j with Netty was Google which just pointed me to the
> http://www.jboss.org/file-access/default/members/netty/freezone/api/3.1/index.html

Yeah we need a better FAQ page.  I'm working on it.

> Anyways with I figured it out: InternalLoggerFactory.setDefaultFactory(new
> Log4JLoggerFactory());
> 
> My questions are as follows...
> 
> 1- Does it matter where the LoggingHandler is added in the pipeline?

Yes.  If you place it before decoder/encoder, it will log hexdump of the
received data.  Otherwise, it will convert the decoded message object to
a String to log it.

> 2- Can we record more then just events. What if there some sort of exception
> that happens internally to netty can that be logged?

Internal exceptions are logged directly by Netty.  If you changed your
logging framework correctly, they will be logged via that logging
framework.  If an exception is associated with a certain channel, it
will trigger the exceptionCaught event and LoggingHandler will log it.

HTH,
Trustin

-- 
what we call human nature in actuality is human habit
http://gleamynode.net/


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
Url : http://lists.jboss.org/pipermail/netty-users/attachments/20100324/59581e79/attachment-0001.bin 


More information about the netty-users mailing list