[ 
https://issues.apache.org/jira/browse/NIFI-3065?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15770754#comment-15770754
 ] 

Pierre Villard commented on NIFI-3065:
--------------------------------------

Working on this one and have a couple of questions.

I started implementing a solution exposing component ID and parent process 
group ID though MDC feature in {{SimpleProcessLogger}} class. I've something 
working for processors but it remains the case where the parent process group 
ID changes when a processor is moved from a process group to another. The main 
issue here (as far as I looked into the code) is: I can catch the update in the 
{{StandardProcessorNode}} class (and update the logger of the node) but I can't 
access the logger of the processor. I see a couple of options:
- Expose the component logger in {{ConfigurableComponent}} interface but isn't 
it something to avoid?
- Have the same logger for both the {{ProcessorNode}} and the {{Processor}}. 
But it would still need to expose the logger somehow ({{Processor}} interface 
or {{ConfigurableComponent}}). Or I could instantiate the {{ComponentLogger}} 
without the reference to the component in the constructor and add this 
reference afterwards.

Before changing a lot of things in the code, feedback would be greatly 
appreciated ;)

Also, regarding {{ReportingTask}} and {{ControllerService}}, I believe this can 
not be associated to a single parent process group and logs generated by such 
components should remain in a global log file (or in log file based on 
component ID). Correct?

> Fine-grained logging in multi-tenant context
> --------------------------------------------
>
>                 Key: NIFI-3065
>                 URL: https://issues.apache.org/jira/browse/NIFI-3065
>             Project: Apache NiFi
>          Issue Type: Improvement
>          Components: Core Framework
>            Reporter: Pierre Villard
>            Priority: Minor
>
> In a multi-tenant approach, it could be interesting to offer to users a way 
> to have a fine-grained logging capabilities per tenant.
> Let's say that root process group is used to have one process group per 
> "project" accessed by different teams/users, it could be really useful to 
> have a log file per process group containing logs for all elements inside 
> this process group.
> A first version could be to develop a custom log appender that would log each 
> message in a file dedicated to its process group parent.
> This improvement will ease the logging management when there are hundreds of 
> processors separated between different teams and this will also prevent the 
> access to the logs concerning one team by another team (could be a security 
> issue).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to