You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2016/01/21 22:23:24 UTC
[Bug 58905] New: Fix Tomcat.silence() to silence the correct logger
and to respect defaults
https://bz.apache.org/bugzilla/show_bug.cgi?id=58905
Bug ID: 58905
Summary: Fix Tomcat.silence() to silence the correct logger and
to respect defaults
Product: Tomcat 9
Version: unspecified
Hardware: PC
Status: NEW
Severity: minor
Priority: P2
Component: Catalina
Assignee: dev@tomcat.apache.org
Reporter: knst.kolinko@gmail.com
Noted when reviewing implementation of Tomcat.silence() in relation to Tomcat
unit tests.
Currently Tomcat.addContext() is implemented as following:
[[[
public Context addContext(Host host, String contextPath, String
contextName,
String dir) {
silence(host, contextPath);
Context ctx = createContext(host, contextPath);
ctx.setName(contextName);
ctx.setPath(contextPath);
ctx.setDocBase(dir);
ctx.addLifecycleListener(new FixContextListener());
if (host == null) {
getHost().addChild(ctx);
} else {
host.addChild(ctx);
}
return ctx;
}
]]]
The silence() call attempts to silence the logger for this Context by setting
its log level to Level.WARNING.
The following notes apply to Tomcat class of all current versions
(Tomcat 7/8/9):
1. Note that in Tomcat unit tests the loggers are not silenced by default,
as Tomcat.setSilent(boolean) is not called by Tomcat test code.
=> The silent(Host, contextPath) call shall respect the defaults and do not
silence this logger if other loggers are not silenced.
2. The Engine name used in Tomcat.getLoggerName() is wrong.
Tomcat.getEngine() uses "Tomcat" as the name, not "default".
=> It shall get the actual Engine instance from Host.getParent().
3. Tomcat.getLoggerName() shall use the same logic as ContainerBase.logName()
=> It does not handle "" and null names correctly.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 58905] Fix Tomcat.silence() to silence the correct logger and
to respect defaults
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58905
--- Comment #2 from Mark Thomas <ma...@apache.org> ---
Fixed in 8.0.x for 8.0.32 onwards.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 58905] Fix Tomcat.silence() to silence the correct logger and
to respect defaults
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58905
Mark Thomas <ma...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #3 from Mark Thomas <ma...@apache.org> ---
Fixed in 7.0.x for 7.0.68 onwards.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 58905] Fix Tomcat.silence() to silence the correct logger and
to respect defaults
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58905
Mark Thomas <ma...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
OS| |All
--- Comment #1 from Mark Thomas <ma...@apache.org> ---
Fixed in 9.0.x for 9.0.0.M3 onwards.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org