[
https://issues.apache.org/jira/browse/PROTON-2163?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16995014#comment-16995014
]
Timothy A. Bish commented on PROTON-2163:
-----------------------------------------
The library already supports an option for those who want to capture frame data
via a logging framework like the JUL logger or an abstraction library like
slf4j. The
[ProtocolTracer|https://github.com/apache/qpid-proton-j/blob/master/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/ProtocolTracer.java]
interface in the proton-j library can be set on the Transport and your logging
can then write out frame data based on configuration. We use this approach in
the Qpid JMS client and other projects like ActiveMQ use it as well.
You could use the tracer as follows, tailoring the output to your own desired
format:
{code:java}
if (isTraceFrames()) {
((TransportImpl) protonTransport).setProtocolTracer(new ProtocolTracer() {
@Override
public void receivedFrame(TransportFrame transportFrame) {
TRACE_FRAMES.trace("RECV: {}", transportFrame.getBody());
}
@Override
public void sentFrame(TransportFrame transportFrame) {
TRACE_FRAMES.trace("SENT: {}", transportFrame.getBody());
}
});
}{code}
> Use java.util.logging to log trace frames PN_TRACE_FRM instead of stdout
> ------------------------------------------------------------------------
>
> Key: PROTON-2163
> URL: https://issues.apache.org/jira/browse/PROTON-2163
> Project: Qpid Proton
> Issue Type: Improvement
> Components: proton-j
> Affects Versions: proton-j-0.33.3
> Reporter: Connie Yau
> Priority: Major
> Original Estimate: 2m
> Remaining Estimate: 2m
>
> If PN_TRACE_FRM=1, the AMQP trace frames are logged to standard out. It would
> be nice to use java.util.logging.Logger so customers have the option of
> logging to a text file instead of STDOUT.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]