Skip to content

Commit 9726c99

Browse files
jfedorukecheyne
authored andcommitted
BAEL-2279 - Logging reactive sequence (eugenp#5667)
* BAEL-2279 - Logging reactive sequence * BAEL-2279 - Logging reactive sequence * Format fix. * Add all examples. Fix formatting. * BAEL 2279 - rename file, formatting fixes, update deps.
1 parent 7e9f961 commit 9726c99

2 files changed

Lines changed: 30 additions & 1 deletion

File tree

‎logging-modules/log4j/pom.xml‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
34
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
45
<modelVersion>4.0.0</modelVersion>
56
<groupId>com.baeldung</groupId>
@@ -43,13 +44,20 @@
4344
<artifactId>disruptor</artifactId>
4445
<version>${disruptor.version}</version>
4546
</dependency>
47+
<!-- Webflux for reactive logging example -->
48+
<dependency>
49+
<groupId>org.springframework.boot</groupId>
50+
<artifactId>spring-boot-starter-webflux</artifactId>
51+
<version>${spring-boot.version}</version>
52+
</dependency>
4653
</dependencies>
4754

4855
<properties>
4956
<log4j.version>1.2.17</log4j.version>
5057
<log4j-api.version>2.7</log4j-api.version>
5158
<log4j-core.version>2.7</log4j-core.version>
5259
<disruptor.version>3.3.6</disruptor.version>
60+
<spring-boot.version>2.1.0.RELEASE</spring-boot.version>
5361
</properties>
5462

5563
</project>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package com.baeldung.webFluxLogging;
2+
3+
import reactor.core.publisher.Flux;
4+
5+
public class WebFluxLoggingExample {
6+
7+
public static void main(String[] args) {
8+
Flux<Integer> reactiveStream = Flux.range(1, 5).log();
9+
10+
reactiveStream.subscribe();
11+
12+
reactiveStream = Flux.range(1, 5).log().take(3);
13+
14+
reactiveStream.subscribe();
15+
16+
reactiveStream = Flux.range(1, 5).take(3).log();
17+
18+
reactiveStream.subscribe();
19+
}
20+
21+
}

0 commit comments

Comments
 (0)