Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 365411 - ProxyServlet contains two loggers
Summary: ProxyServlet contains two loggers
Status: RESOLVED FIXED
Alias: None
Product: Jetty
Classification: RT
Component: server (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 trivial (vote)
Target Milestone: 7.5.x   Edit
Assignee: Thomas Becker CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-02 06:07 EST by Thomas Becker CLA
Modified: 2012-01-06 09:47 EST (History)
3 users (show)

See Also:


Attachments
proposed patch (18.95 KB, patch)
2011-12-02 06:25 EST, Thomas Becker CLA
no flags Details | Diff
proposed patch (15.81 KB, patch)
2011-12-06 03:58 EST, Thomas Becker CLA
no flags Details | Diff
proposed patch (1.79 KB, patch)
2011-12-12 04:38 EST, Thomas Becker CLA
no flags Details | Diff
Patch removing the logger (1.80 KB, patch)
2012-01-05 13:45 EST, Thomas Becker CLA
no flags Details | Diff
2nd commit removing the whitespaces (15.26 KB, patch)
2012-01-05 13:46 EST, Thomas Becker CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Becker CLA 2011-12-02 06:07:33 EST
Build Identifier: 

And should contain only one. 

Reproducible: Always
Comment 1 Thomas Becker CLA 2011-12-02 06:25:47 EST
Created attachment 207831 [details]
proposed patch
Comment 2 Jan Bartel CLA 2011-12-05 01:48:53 EST
Agreed that there should only be one. I think the existing code allows for different log configurations for different instances of the ProxyServlet - that seems to be deliberate, so I'd ask around a bit before removing that ability.

Also, it seems that quite a few lines in the patch are whitespace replacements - do you know if your settings are up-to-date, or if that is mal-formatted original src?

Jan
Comment 3 Thomas Becker CLA 2011-12-05 03:07:10 EST
Having different loggers for different instances might make sense for some ppl. I still think it's an edge case, but if you like to keep it, lets keep it in.

I've an eclipse save action which removes trailing whitespaces.
Comment 4 Jan Bartel CLA 2011-12-05 21:48:37 EST
Well, its likely that you could have 2 ProxyServlets configured, both for different addresses, and you'd like to know which one generated the log messages. That's why I think we need to keep the code that calls createLogger().

If anything, we probably should remove the static logger that probably got added when the logging system changed.

So we should probably replace all calls to LOG.x with _log.x ?

Jan
Comment 5 Thomas Becker CLA 2011-12-06 03:58:48 EST
Created attachment 207959 [details]
proposed patch

Yes, as said. I see the use case and I agree.

Atached is another patch removing the static logger. It has only been used in the onException methods.
Comment 6 Thomas Becker CLA 2011-12-06 03:59:44 EST
Leave it up to you to decide if we keep the current code or remove the static logger. Both make sense, but I'd prefer to have only one logger per instance and remove the static one.
Comment 7 Jan Bartel CLA 2011-12-12 01:51:32 EST
Hi Thomas,

I think your second patch is best (ie remove the static logger). But ... can we have a patch that does not include all of the whitespace changes? It's essentially a 1 line patch, but gets obscured by all the whitespace changes. I'd just make the change myself, but its good to get you karma for submitting patches :)

Jan

(In reply to comment #6)
> Leave it up to you to decide if we keep the current code or remove the static
> logger. Both make sense, but I'd prefer to have only one logger per instance
> and remove the static one.
Comment 8 Thomas Becker CLA 2011-12-12 04:38:47 EST
Created attachment 208245 [details]
proposed patch

Patch without whitespace changes attached. However I think those trailing whitespaces should be removed. If you want I can provide a patch with two commmits. One for the whitespaces and one for the actual change.
Comment 9 Jan Bartel CLA 2011-12-22 17:10:34 EST
Yes, a patch without the whitespaces would be good. Assigning to you.
Comment 10 Thomas Becker CLA 2012-01-05 13:45:03 EST
Created attachment 209093 [details]
Patch removing the logger
Comment 11 Thomas Becker CLA 2012-01-05 13:46:21 EST
Created attachment 209094 [details]
2nd commit removing the whitespaces

Hey Jan,

please use the last two patch files as you wish. The first is the actual patch removing the logger and the second removes the unnecessarily whitespaces.

Cheers,
Thomas
Comment 12 Simone Bordet CLA 2012-01-06 09:47:37 EST
Reviewed and applied patches.