Skip to content

Commit c639ee6

Browse files
committed
1) Remove obsolete references to Log4J.
2) Javadoc clean-up.
1 parent 740b647 commit c639ee6

File tree

1 file changed

+34
-27
lines changed

1 file changed

+34
-27
lines changed

src/main/java/org/owasp/esapi/Logger.java

Lines changed: 34 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
package org.owasp.esapi;
1717

1818
/**
19-
* The Logger interface defines a set of methods that can be used to log
19+
* The {@code Logger} interface defines a set of methods that can be used to log
2020
* security events. It supports a hierarchy of logging levels which can be configured at runtime to determine
2121
* the severity of events that are logged, and those below the current threshold that are discarded.
2222
* Implementors should use a well established logging library
2323
* as it is quite difficult to create a high-performance logger.
24-
* <P>
24+
* <p>
2525
* The logging levels defined by this interface (in descending order) are:
2626
* <ul>
2727
* <li>fatal (highest value)</li>
@@ -33,9 +33,9 @@
3333
* </ul>
3434
* There are also several variations of {@code always()} methods that will <i>always</i>
3535
* log a message regardless of the log level.
36-
* <p>
36+
* </p><p>
3737
* ESAPI also allows for the definition of the type of log event that is being generated.
38-
* The Logger interface predefines 6 types of Log events:
38+
* The {@code Logger} interface predefines 6 types of Log events:
3939
* <ul>
4040
* <li>SECURITY_SUCCESS</li>
4141
* <li>SECURITY_FAILURE</li>
@@ -44,47 +44,54 @@
4444
* <li>EVENT_FAILURE</li>
4545
* <li>EVENT_UNSPECIFIED</li>
4646
* </ul>
47-
* <p>
48-
* Your implementation can extend or change this list if desired.
49-
* <p>
50-
* This Logger allows callers to determine which logging levels are enabled, and to submit events
47+
* </p><p>
48+
* Your custom implementation can extend or change this list if desired.
49+
* </p><p>
50+
* This {@code Logger} allows callers to determine which logging levels are enabled, and to submit events
5151
* at different severity levels.<br>
5252
* <br>Implementors of this interface should:
5353
*
5454
* <ol>
55-
* <li>provide a mechanism for setting the logging level threshold that is currently enabled. This usually works by logging all
55+
* <li>Provide a mechanism for setting the logging level threshold that is currently enabled. This usually works by logging all
5656
* events at and above that severity level, and discarding all events below that level.
5757
* This is usually done via configuration, but can also be made accessible programmatically.</li>
58-
* <li>ensure that dangerous HTML characters are encoded before they are logged to defend against malicious injection into logs
58+
* <li>Ensure that dangerous HTML characters are encoded before they are logged to defend against malicious injection into logs
5959
* that might be viewed in an HTML based log viewer.</li>
60-
* <li>encode any CRLF characters included in log data in order to prevent log injection attacks.</li>
61-
* <li>avoid logging the user's session ID. Rather, they should log something equivalent like a
60+
* <li>Encode any CRLF characters included in log data in order to prevent log injection attacks.</li>
61+
* <li>Avoid logging the user's session ID. Rather, they should log something equivalent like a
6262
* generated logging session ID, or a hashed value of the session ID so they can track session specific
6363
* events without risking the exposure of a live session's ID.</li>
64-
* <li>record the following information with each event:</li>
64+
* <li>Record the following information with each event:</li>
6565
* <ol type="a">
66-
* <li>identity of the user that caused the event,</li>
67-
* <li>a description of the event (supplied by the caller),</li>
68-
* <li>whether the event succeeded or failed (indicated by the caller),</li>
69-
* <li>severity level of the event (indicated by the caller),</li>
70-
* <li>that this is a security relevant event (indicated by the caller),</li>
71-
* <li>hostname or IP where the event occurred (and ideally the user's source IP as well),</li>
72-
* <li>a time stamp</li>
66+
* <li>Identity of the user that caused the event.</li>
67+
* <li>A description of the event (supplied by the caller).</li>
68+
* <li>Whether the event succeeded or failed (indicated by the caller).</li>
69+
* <li>Severity level of the event (indicated by the caller).</li>
70+
* <li>That this is a security relevant event (indicated by the caller).</li>
71+
* <li>Hostname or IP where the event occurred (and ideally the user's source IP as well).</li>
72+
* <li>A date/time stamp.</li>
7373
* </ol>
7474
* </ol>
7575
*
7676
* Custom logger implementations might also:
7777
* <ol start="6">
78-
* <li>filter out any sensitive data specific to the current application or organization, such as credit cards,
78+
* <li>Filter out any sensitive data specific to the current application or organization, such as credit cards,
7979
* social security numbers, etc.</li>
8080
* </ol>
8181
*
82-
* There are both Log4j and native Java Logging default implementations. JavaLogger uses the java.util.logging package as the basis for its logging
83-
* implementation. Both default implementations implements requirements #1 thru #5 above.<br>
84-
* <br>
85-
* Customization: It is expected that most organizations will implement their own custom Logger class in
86-
* order to integrate ESAPI logging with their logging infrastructure. The ESAPI Reference Implementation
87-
* is intended to provide a simple functional example of an implementation.
82+
* There are both SLF4J and native Java Logging (i.e., {@code java.util.logging}, aka JUL) implementations
83+
* of the ESAPI logger with JUL being our default logger for our stock <b>ESAPI.properties</b> file that
84+
* is delivered along with ESAPI releases in a separate <b>esapi-configuration</b> jar available from the
85+
* releases mentioned on
86+
* <a href="https://github.com/ESAPI/esapi-java-legacy/releases/">ESAPI's GitHub Releases page</a>.
87+
* </p><p>
88+
* The {@code org.owasp.esapi.logging.java.JavaLogger} class uses the {@code java.util.logging} package as
89+
* the basis for its logging implementation. Both provided implementations implement requirements #1 through #5 above.
90+
* </p><p>
91+
* <i>Customization</i>: It is expected that most organizations may wish to implement their own custom {@code Logger} class in
92+
* order to integrate ESAPI logging with their specific logging infrastructure. The ESAPI feference implementations
93+
* can serve as a useful starting point to intended to provide a simple functional example of an implementation, but
94+
* they are also largely usuable out-of-the-box with some additional minimal log configuration.
8895
*
8996
* @author Jeff Williams (jeff.williams .at. aspectsecurity.com) <a
9097
* href="http://www.aspectsecurity.com">Aspect Security</a>

0 commit comments

Comments
 (0)