Time for action – logging to the console
It's not always convenient to have to look at log files, particularly when we already have the agent screen open. Let's modify the agent to also log events to the screen.
Restart the Flume agent with an additional argument:
$ flume-ng agent --conf conf --conf-file 10a.conf --name agent1 -Dflume.root.logger=INFO,console
You will receive the following response:
Info: Sourcing environment configuration script /home/hadoop/flume/conf/flume-env.sh … org.apache.flume.node.Application --conf-file 10a.conf --name agent1 2012-08-19 00:41:45,462 (main) [INFO - org.apache.flume.lifecycle.LifecycleSupervisor.start(LifecycleSupervisor.java:67)] Starting lifec
In another window, connect to the server via curl:
$ curl telnet://localhost:3000
Type in
Hello
andFlume
on separate lines, hit Ctrl + C, and then check the agent window:
What just happened?
We added this example as it becomes very useful when debugging or creating new flows.
As seen in the previous example...