Bug 535685 (RHQ-2355)

Summary: RFE: provide plugins with their own logger to their own log file
Product: [Other] RHQ Project Reporter: John Mazzitelli <mazz>
Component: Plugin ContainerAssignee: Nobody <nobody>
Status: NEW --- QA Contact:
Severity: medium Docs Contact:
Priority: low    
Version: unspecifiedCC: jshaughn
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: All   
URL: http://jira.rhq-project.org/browse/RHQ-2355
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description John Mazzitelli 2009-08-14 14:23:00 UTC
It would be nice if our resource contexts and discovery contexts had a "getLogger()" method that returns a commons logger object that allows a plugin to log messages in their own log file (say, to "logs/plugins/<plugin-name>.log")

We'd have to programatically create the log4j appender at runtime when the plugin requests the logger for the first time.

Comment 1 Red Hat Bugzilla 2009-11-10 21:02:47 UTC
This bug was previously known as http://jira.rhq-project.org/browse/RHQ-2355


Comment 2 Joseph Marques 2010-11-17 16:55:57 UTC
mazz, interesting.  i think this would be very useful from a maintenance standpoint.  if a user/customer is having an issue with their, say, apache or vhost resources...then all we'd need is their apache plugin log file.  however, this becomes more complicated if the hibernate plugin logs to its own log file, which is then injected into several other plugins for reuse.  can you elaborate a bit more on how you would expect these loggers to work in the context of plugin inheritance - injection / extension.

Comment 3 Corey Welton 2010-11-22 18:04:45 UTC
mazz, any more recent thoughts?

Comment 4 John Mazzitelli 2010-11-22 18:23:04 UTC
we could have one logger per resource INSTANCE. in that case, injection/extension shouldn't matter. I don't know how to implement this - all I know is, from an API perspective, it would be cool for a plugin developer to be given his own log file. Is that one log file per plugin? one log file per resource instance? one log file per resource type? I'm not sure. I just figured it was a neat request to put on the list for further discussion as a future API enhancement.

Comment 5 Jay Shaughnessy 2014-05-09 15:44:10 UTC
I still think this would be a good thing to do.

Comment 6 Jay Shaughnessy 2014-05-09 15:44:37 UTC
I still think this would be a good thing to do.