This site is the archived OWASP Foundation Wiki and is no longer accepting Account Requests.
To view the new OWASP Foundation website, please visit https://owasp.org
Difference between revisions of "Poor Logging Practice"
From OWASP
Weilin Zhong (talk | contribs) |
Weilin Zhong (talk | contribs) (→Abstract) |
||
Line 4: | Line 4: | ||
==Abstract== | ==Abstract== | ||
− | + | Loggers should be declared to be static and final. | |
==Description== | ==Description== |
Revision as of 16:01, 21 July 2006
This is a Vulnerability. To view all vulnerabilities, please see the Vulnerability Category page.
Abstract
Loggers should be declared to be static and final.
Description
It is good programming practice to share a single logger object between all of the instances of a particular class and to use the same logger for the duration of the program.
Examples
The following statement errantly declares a non-static logger.
private final Logger logger = Logger.getLogger(MyClass.class);