org.springframework.integration.handler.LoggingHandler Java Examples
The following examples show how to use
org.springframework.integration.handler.LoggingHandler.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LogSinkApplicationTests.java From spring-cloud-stream-app-starters with Apache License 2.0 | 6 votes |
@Test public void test() { assertNotNull(this.sink.input()); assertEquals(LoggingHandler.Level.WARN, this.logSinkHandler.getLevel()); Log logger = TestUtils.getPropertyValue(this.logSinkHandler, "messageLogger", Log.class); assertEquals("foo", TestUtils.getPropertyValue(logger, "name")); logger = spy(logger); new DirectFieldAccessor(this.logSinkHandler).setPropertyValue("messageLogger", logger); GenericMessage<String> message = new GenericMessage<>("foo"); this.sink.input().send(message); ArgumentCaptor<Object> captor = ArgumentCaptor.forClass(Object.class); verify(logger).warn(captor.capture()); assertEquals("FOO", captor.getValue()); this.logSinkHandler.setExpression("#this"); this.sink.input().send(message); verify(logger, times(2)).warn(captor.capture()); assertSame(message, captor.getValue()); }
Example #2
Source File: LogSinkConfiguration.java From spring-cloud-stream-app-starters with Apache License 2.0 | 5 votes |
@Bean @ServiceActivator(inputChannel = Sink.INPUT) public LoggingHandler logSinkHandler() { LoggingHandler loggingHandler = new LoggingHandler(this.properties.getLevel().name()); loggingHandler.setExpression(this.properties.getExpression()); loggingHandler.setLoggerName(this.properties.getName()); return loggingHandler; }
Example #3
Source File: LogSinkProperties.java From spring-cloud-stream-app-starters with Apache License 2.0 | 4 votes |
@NotNull public LoggingHandler.Level getLevel() { return level; }
Example #4
Source File: LogSinkProperties.java From spring-cloud-stream-app-starters with Apache License 2.0 | 4 votes |
public void setLevel(LoggingHandler.Level level) { this.level = level; }
Example #5
Source File: FunctionSampleSpringIntegrationApplication.java From spring-cloud-function with Apache License 2.0 | 4 votes |
@Bean public IntegrationFlow uppercaseFlow() { return IntegrationFlows.from(MessageFunction.class, "uppercase") .<String, String>transform(String::toUpperCase) .logAndReply(LoggingHandler.Level.WARN); }
Example #6
Source File: ImplicitFunctionBindingTests.java From spring-cloud-stream with Apache License 2.0 | 4 votes |
@Bean public IntegrationFlow uppercaseFlow() { return IntegrationFlows.from(MessageFunction.class, gateway -> gateway.beanName("uppercase")) .<String, String>transform(String::toUpperCase).logAndReply(LoggingHandler.Level.WARN); }