Skip to content

Commit

Permalink
Add logging with SLF4J
Browse files Browse the repository at this point in the history
  • Loading branch information
viren-nadkarni committed Feb 3, 2025
1 parent 967ecaa commit 74f57b2
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.flink.streaming.api.environment.LocalStreamEnvironment;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.util.Map;
import java.util.Properties;

public class StreamingJob {

private static final Logger LOGGER = LogManager.getLogger(StreamingJob.class);
private static final Logger LOGGER = LoggerFactory.getLogger(StreamingJob.class);

// Create ObjectMapper instance to serialise POJOs into JSONs
private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
Expand Down Expand Up @@ -55,6 +55,8 @@ public static void main(String[] args) throws Exception {
DataStream<StockPrice> kinesis = env.fromSource(
source, WatermarkStrategy.noWatermarks(), "data-generator").setParallelism(1);

LOGGER.info("Executing printer job...");

// Print
kinesis.print();

Expand Down

0 comments on commit 74f57b2

Please sign in to comment.