Support Questions

Find answers, ask questions, and share your expertise

how to store failure as logs in a particular directory or mail with in Nifi?

avatar
Rising Star

I have flow like get files from FTP to HDFS.

1.In Each process i need to store failure as log and store in a particular location

2.In Each process i need to store failure as log and mail to admin(mail id)

Thanks In Advance

1 ACCEPTED SOLUTION

avatar
Master Mentor

There are a few things you can do here if i am understanding correctly what you are trying to accomplish.

1. The logback.xml can be modified so specific processor component logs could be redirected to a specific new log file. You can specify where that new log is written. You could also specify the specific log level of those components (WARN level would get you just WARN and ERROR messages). 2. In your dataflow you could use the TailFile processor to monitor that new log and route any generated FlowFiles to a putEmail processor to send them to your Admin. In addition to email you can route those FlowFiles to a processor of your choice to put a copy to a specific location as well either locally or remotely.

Thanks,

Matt

View solution in original post

1 REPLY 1

avatar
Master Mentor

There are a few things you can do here if i am understanding correctly what you are trying to accomplish.

1. The logback.xml can be modified so specific processor component logs could be redirected to a specific new log file. You can specify where that new log is written. You could also specify the specific log level of those components (WARN level would get you just WARN and ERROR messages). 2. In your dataflow you could use the TailFile processor to monitor that new log and route any generated FlowFiles to a putEmail processor to send them to your Admin. In addition to email you can route those FlowFiles to a processor of your choice to put a copy to a specific location as well either locally or remotely.

Thanks,

Matt