"Fossies" - the Fresh Open Source Software Archive
Member "apache-log4j-2.12.4-src/log4j-samples/log4j-samples-flume-embedded/README.txt" (20 Dec 2021, 1707 Bytes) of package /linux/misc/apache-log4j-2.12.4-src.tar.gz:
As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard
) with prefixed line numbers.
Alternatively you can here view
the uninterpreted source code file.
1 Sample to utilize an embedded Flume agent to connect to a remote Flume Agent via Avro.
3 This sample uses the classes in the sample flume-common project. It will randomly pick from the events defined there
4 and send them to Flume. At the same time it will intermix some random non-audit events.
6 To run this sample:
7 1. Run "mvn install" on the log4j-samples-flume-common project.
8 2. Download and install Flume.
9 3. Copy the flume-conf.properties in src/main/resources/flume/conf to the conf directory of where Flume was installed.
10 4. In a terminal window start flume using "bin/flume-ng agent --conf ./conf/ -f conf/flume-conf.properties -Dflume.root.logger=DEBUG,console -n agent"
11 5. Verify Flume started and configured an Avro source, a memory channel and a logger sink by reviewing the startup log.
12 6. In a separate terminal window run "mvn jetty:run" in this project.
13 7. Verify the Flume appender connected to the Flume agent by finding "Started SelectChannelConnector@0.0.0.0:8080"
14 in the jetty log and that there are no exceptions and also by seeing something like
15 "/127.0.0.1:53351 => /127.0.0.1:8800] OPEN" in the Flume log.
16 8. In a separate terminal window in the project directory run "tail -f target/logs/app.log" to see the application
17 generate non-audit logs.
18 9. In the browser go to url "http://localhost:8080/flumeAgent/start.do". A started message should appear on the screen.
19 10. After verifying logs are being written click on the Stop button in the browser page.
21 The output from the Flume agent will include the generated Flume events. Since the events are sent by the embedded
22 Flume agent in a batch the Flume agent will only print a hex dump of the first few bytes of the event.