FLume收集log4j日誌配置實踐
log4j.appender.flume=org.apache.flume.clients.log4jappender.Log4jAppender log4j.appender.flume.layout=org.apache.log4j.PatternLayout log4j.appender.flume.Hostname=localhost//flume的ip log4j.appender.flume.Port=44444//flume的埠 flume配置: a1.sources = r1 a1.sinks = k1 a1.channels = c1 # Describe/configure the source a1.sources.r1.type = avro a1.sources.r1.bind = localhost a1.sources.r1.port = 44444 # Describe the sink a1.sinks.k1.type = logger # Use a channel which buffers events in memory a1.channels.c1.type = memory a1.channels.c1.capacity = 1000 a1.channels.c1.transactionCapacity = 100 # Bind the source and sink to the channel a1.sources.r1.channels = c1 a1.sinks.k1.channel = c1 啟動flume ../bin/flume-ng agent --conf ./ --conf-file flume-conf.properties --name a1 -Dflume.root.logger=INFO,console ,執行專案,可看到flume輸出日誌資訊。