Search in sources :

Example 1 with LogEventSender

use of org.apache.cxf.ext.logging.event.LogEventSender in project cxf by apache.

the class OldLoggingFactoryBeanListener method addLoggingSupport.

private void addLoggingSupport(Endpoint endpoint, Bus bus, Logging annotation) {
    if (annotation != null) {
        LoggingFeature lf = new LoggingFeature();
        lf.setPrettyLogging(annotation.pretty());
        lf.setLimit(annotation.limit());
        lf.setLogBinary(annotation.showBinary());
        lf.setLogBinary(annotation.showBinary());
        LogEventSender in = createEventSender(annotation.outLocation());
        if (in != null) {
            lf.setOutSender(in);
        }
        LogEventSender out = createEventSender(annotation.inLocation());
        if (out != null) {
            lf.setInSender(out);
        }
        lf.initialize(endpoint, bus);
    }
}
Also used : LogEventSender(org.apache.cxf.ext.logging.event.LogEventSender)

Example 2 with LogEventSender

use of org.apache.cxf.ext.logging.event.LogEventSender in project cxf by apache.

the class TestPrettyLoggingFilter method filter.

private void filter(String payload, String expected, boolean truncated) {
    LogEvent logEvent = new LogEvent();
    logEvent.setPayload(payload);
    logEvent.setContentType("text/xml");
    logEvent.setTruncated(truncated);
    LogEventSender dummy = new LogEventSender() {

        public void send(LogEvent event) {
        }
    };
    PrettyLoggingFilter prettyFilter = new PrettyLoggingFilter(dummy);
    prettyFilter.setPrettyLogging(true);
    prettyFilter.send(logEvent);
    assertEquals(expected, logEvent.getPayload());
}
Also used : LogEventSender(org.apache.cxf.ext.logging.event.LogEventSender) PrettyLoggingFilter(org.apache.cxf.ext.logging.event.PrettyLoggingFilter) LogEvent(org.apache.cxf.ext.logging.event.LogEvent)

Aggregations

LogEventSender (org.apache.cxf.ext.logging.event.LogEventSender)2 LogEvent (org.apache.cxf.ext.logging.event.LogEvent)1 PrettyLoggingFilter (org.apache.cxf.ext.logging.event.PrettyLoggingFilter)1