Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -192,17 +192,16 @@ public static int getDefaultLoggingLevel() {
}

/**
* Creates a new instance of {@link AbstractSessionLog} class.
* Creates a new instance of {@linkplain AbstractSessionLog} class.
*/
protected AbstractSessionLog() {
this.writer = new PrintWriter(System.out);
this.level = getDefaultLoggingLevel();
}

/**
* PUBLIC:
* <p>
* Return the log level. It is used when session is not available.
* Return the log level.
* It is used when session is not available.
*
* @return the log level
*/
Expand All @@ -212,8 +211,6 @@ public int getLevel() {
}

/**
* PUBLIC:
* <p>
* Return the log level as a string value.
*/
@Override
Expand All @@ -222,8 +219,6 @@ public String getLevelString() {
}

/**
* PUBLIC:
* <p>
* Return the log level for the category name space.
*
* @return the log level
Expand All @@ -235,8 +230,6 @@ public int getLevel(String category) {
}

/**
* PUBLIC:
* <p>
* Set the log level. It is used when session is not available.
*
* @param level the new log level
Expand All @@ -247,8 +240,6 @@ public void setLevel(int level) {
}

/**
* PUBLIC:
* <p>
* Set the log level for the category name space.
*
* @param level the new log level
Expand All @@ -260,8 +251,6 @@ public void setLevel(int level, String category) {
}

/**
* PUBLIC:
* <p>
* Check if a message of the given level would actually be logged.
* It is used when session is not available.
*
Expand All @@ -274,8 +263,6 @@ public boolean shouldLog(int level) {
}

/**
* PUBLIC:
* <p>
* Check if a message of the given level would actually be logged for the category name space.
* !isOff() is checked to screen out the possibility when both
* log level and log request level are set to OFF.
Expand All @@ -290,8 +277,6 @@ public boolean shouldLog(int level, String category) {
}

/**
* PUBLIC:
* <p>
* Return the singleton SessionLog. If the singleton SessionLog does not exist,
* a new one is created based on the version of JDK being used from the Version class.
*
Expand All @@ -305,10 +290,7 @@ public static SessionLog getLog() {
}

/**
* PUBLIC:
* <p>
* Set the singleton SessionLog.
* </p>
*
* @param sessionLog a SessionLog
*/
Expand Down Expand Up @@ -478,11 +460,11 @@ public void setShouldPrintConnection(boolean shouldPrintConnection) {
}

/**
* Whether the {@link Exception} stack trace should be logged.
* Whether the {@linkplain Exception} stack trace should be logged.
* By default, the stack is logged for FINER or less (finest). The logging of the stack
* can be explicitly turned on or off.
*
* @return value of {@code true} when the {@link Exception} stack trace should be logged
* @return value of {@code true} when the {@linkplain Exception} stack trace should be logged
* or {@code false} otherwise
*/
@Override
Expand All @@ -493,9 +475,9 @@ public boolean shouldLogExceptionStackTrace() {
}

/**
* Turn {@link Exception} stack trace logging on or off explicitly.
* Turn {@linkplain Exception} stack trace logging on or off explicitly.
*
* @param shouldLogExceptionStackTrace value of {@code true} when the {@link Exception} stack trace
* @param shouldLogExceptionStackTrace value of {@code true} when the {@linkplain Exception} stack trace
* should be logged or {@code false} otherwise
*/
@Override
Expand Down Expand Up @@ -579,8 +561,6 @@ public void setShouldPrintThread(boolean shouldPrintThread) {
}

/**
* PUBLIC:
* <p>
* Return the writer that will receive the formatted log entries.
*
* @return the log writer
Expand All @@ -591,8 +571,6 @@ public Writer getWriter() {
}

/**
* PUBLIC:
* <p>
* Set the writer that will receive the formatted log entries.
*
* @param writer the log writer
Expand All @@ -604,8 +582,6 @@ public void setWriter(Writer writer) {


/**
* PUBLIC:
* <p>
* Set the writer that will receive the formatted log entries.
*
* @param outputstream the log writer
Expand Down Expand Up @@ -760,7 +736,6 @@ protected String getPrefixString(int level, String category) {
}

/**
* PUBLIC:
* Set the date-time format to be used when printing a log entry date.
*
* @param timeStampFormatter Formatter for printing time stamp in the log entry.
Expand Down Expand Up @@ -796,16 +771,14 @@ protected String formatMessage(SessionLogEntry entry) {
* Translate the string value of the log level to the constant value.
* If value is {@code null} or invalid use the default.
*
* @return the constant value of the provided log level {@link String}
* @return the constant value of the provided log level {@linkplain String}
*/
public static int translateStringToLoggingLevel(String loggingLevel) {
final LogLevel logLevel = LogLevel.toValue(loggingLevel);
return logLevel != null ? logLevel.getId() : LogLevel.INFO.getId();
}

/**
* PUBLIC:
* <p>
* Log a throwable at FINER level.
*
* @param throwable a Throwable
Expand Down Expand Up @@ -888,8 +861,6 @@ public void finest(Supplier<String> messageSupplier) {
}

/**
* PUBLIC:
* <p>
* Log a throwable with level.
*
* @param level the log request level value
Expand All @@ -904,8 +875,6 @@ public void logThrowable(int level, Throwable throwable) {
}

/**
* PUBLIC:
* <p>
* Log a throwable with level.
*
* @param level the log request level value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,33 +18,32 @@
import java.util.Map;

/**
* EclipseLink categories used for logging name space.
* The EclipseLink categories for the logging name space are:<br>
* EclipseLink categories used for logging name spaces.
* <p>
* The EclipseLink categories are:<br>
* <table>
* <caption>Logging categories</caption>
* <tr><td>&nbsp;</td><td>ALL</td> <td>&nbsp;</td><td>= "all"</td></tr>
* <tr><td>&nbsp;</td><td>CACHE</td> <td>&nbsp;</td><td>= "cache"</td></tr>
* <tr><td>&nbsp;</td><td>CONNECTION</td> <td>&nbsp;</td><td>= "connection"</td></tr>
* <tr><td>&nbsp;</td><td>DDL</td> <td>&nbsp;</td><td>= "ddl"</td></tr>
* <tr><td>&nbsp;</td><td>DMS</td> <td>&nbsp;</td><td>= "dms"</td></tr>
* <tr><td>&nbsp;</td><td>EJB</td> <td>&nbsp;</td><td>= "ejb"</td></tr>
* <tr><td>&nbsp;</td><td>EJB_OR_METADATA</td><td>&nbsp;</td><td>= "ejb_or_metadata"</td></tr>
* <tr><td>&nbsp;</td><td>EVENT</td> <td>&nbsp;</td><td>= "event"</td></tr>
* <tr><td>&nbsp;</td><td>JPA</td> <td>&nbsp;</td><td>= "jpa"</td></tr>
* <tr><td>&nbsp;</td><td>JPARS</td> <td>&nbsp;</td><td>= "jpars"</td></tr>
* <tr><td>&nbsp;</td><td>METADATA</td> <td>&nbsp;</td><td>= "metadata"</td></tr>
* <tr><td>&nbsp;</td><td>METAMODEL</td> <td>&nbsp;</td><td>= "metamodel"</td></tr>
* <tr><td>&nbsp;</td><td>MONITORING</td> <td>&nbsp;</td><td>= "monitoring"</td></tr>
* <tr><td>&nbsp;</td><td>MOXY</td> <td>&nbsp;</td><td>= "moxy"</td></tr>
* <tr><td>&nbsp;</td><td>PROPAGATION</td> <td>&nbsp;</td><td>= "propagation"</td></tr>
* <tr><td>&nbsp;</td><td>PROPERTIES</td> <td>&nbsp;</td><td>= "properties"</td></tr>
* <tr><td>&nbsp;</td><td>QUERY</td> <td>&nbsp;</td><td>= "query"</td></tr>
* <tr><td>&nbsp;</td><td>SEQUENCING</td> <td>&nbsp;</td><td>= "sequencing"</td></tr>
* <tr><td>&nbsp;</td><td>SERVER</td> <td>&nbsp;</td><td>= "server"</td></tr>
* <tr><td>&nbsp;</td><td>SQL</td> <td>&nbsp;</td><td>= "sql"</td></tr>
* <tr><td>&nbsp;</td><td>THREAD</td> <td>&nbsp;</td><td>= "thread"</td></tr>
* <tr><td>&nbsp;</td><td>TRANSACTION</td> <td>&nbsp;</td><td>= "transaction"</td></tr>
* <tr><td>&nbsp;</td><td>WEAVER</td> <td>&nbsp;</td><td>= "weaver"</td></tr>
* <tr><td>&nbsp;</td><td>{@linkplain SessionLog#CACHE}</td> <td>&nbsp;</td><td>= {@value SessionLog#CACHE}</td></tr>
* <tr><td>&nbsp;</td><td>{@linkplain SessionLog#CONNECTION}</td> <td>&nbsp;</td><td>= {@value SessionLog#CONNECTION}</td></tr>
* <tr><td>&nbsp;</td><td>{@linkplain SessionLog#DDL}</td> <td>&nbsp;</td><td>= {@value SessionLog#DDL}</td></tr>
* <tr><td>&nbsp;</td><td>{@linkplain SessionLog#DMS}</td> <td>&nbsp;</td><td>= {@value SessionLog#DMS}</td></tr>
* <tr><td>&nbsp;</td><td>{@linkplain SessionLog#EJB}</td> <td>&nbsp;</td><td>= {@value SessionLog#EJB}</td></tr>
* <tr><td>&nbsp;</td><td>{@linkplain SessionLog#EVENT}</td> <td>&nbsp;</td><td>= {@value SessionLog#EVENT}</td></tr>
* <tr><td>&nbsp;</td><td>{@linkplain SessionLog#JPA}</td> <td>&nbsp;</td><td>= {@value SessionLog#JPA}</td></tr>
* <tr><td>&nbsp;</td><td>{@linkplain SessionLog#JPARS}</td> <td>&nbsp;</td><td>= {@value SessionLog#JPARS}</td></tr>
* <tr><td>&nbsp;</td><td>{@linkplain SessionLog#METADATA}</td> <td>&nbsp;</td><td>= {@value SessionLog#METADATA}</td></tr>
* <tr><td>&nbsp;</td><td>{@linkplain SessionLog#METAMODEL}</td> <td>&nbsp;</td><td>= {@value SessionLog#METAMODEL}</td></tr>
* <tr><td>&nbsp;</td><td>{@linkplain SessionLog#MONITORING}</td> <td>&nbsp;</td><td>= {@value SessionLog#MONITORING}</td></tr>
* <tr><td>&nbsp;</td><td>{@linkplain SessionLog#MOXY}</td> <td>&nbsp;</td><td>= {@value SessionLog#MOXY}</td></tr>
* <tr><td>&nbsp;</td><td>{@linkplain SessionLog#PROPAGATION}</td> <td>&nbsp;</td><td>= {@value SessionLog#PROPAGATION}</td></tr>
* <tr><td>&nbsp;</td><td>{@linkplain SessionLog#PROPERTIES}</td> <td>&nbsp;</td><td>= {@value SessionLog#PROPERTIES}</td></tr>
* <tr><td>&nbsp;</td><td>{@linkplain SessionLog#QUERY}</td> <td>&nbsp;</td><td>= {@value SessionLog#QUERY}</td></tr>
* <tr><td>&nbsp;</td><td>{@linkplain SessionLog#SEQUENCING}</td> <td>&nbsp;</td><td>= {@value SessionLog#SEQUENCING}</td></tr>
* <tr><td>&nbsp;</td><td>{@linkplain SessionLog#SERVER}</td> <td>&nbsp;</td><td>= {@value SessionLog#SERVER}</td></tr>
* <tr><td>&nbsp;</td><td>{@linkplain SessionLog#SQL}</td> <td>&nbsp;</td><td>= {@value SessionLog#SQL}</td></tr>
* <tr><td>&nbsp;</td><td>{@linkplain SessionLog#THREAD}</td> <td>&nbsp;</td><td>= {@value SessionLog#THREAD}</td></tr>
* <tr><td>&nbsp;</td><td>{@linkplain SessionLog#TRANSACTION}</td> <td>&nbsp;</td><td>= {@value SessionLog#TRANSACTION}</td></tr>
* <tr><td>&nbsp;</td><td>{@linkplain SessionLog#WEAVER}</td> <td>&nbsp;</td><td>= {@value SessionLog#WEAVER}</td></tr>
* </table>
*/
public enum LogCategory {
Expand Down Expand Up @@ -79,7 +78,7 @@ public enum LogCategory {
/** Logger name spaces prefix. */
private static final String NAMESPACE_PREFIX = "eclipselink.logging.";

/** {@link Map} for {@link String} to {@link LogCategory} case insensitive conversion. */
/** {@linkplain Map} for {@linkplain String} to {@linkplain LogCategory} case insensitive conversion. */
private static final Map<String, LogCategory> stringValuesMap = new HashMap<>(2 * length);

/** Logger name spaces lookup table. */
Expand All @@ -101,10 +100,10 @@ public enum LogCategory {
}

/**
* Returns {@link LogCategory} object holding the value of the specified {@link String}.
* @param name The {@link String} to be parsed.
* @return {@link LogCategory} object holding the value represented by the string argument or {@code null} when
* there exists no corresponding {@link LogCategory} object to provided argument value. {@code null} value
* Returns {@linkplain LogCategory} object holding the value of the specified {@linkplain String}.
* @param name The {@linkplain String} to be parsed.
* @return {@linkplain LogCategory} object holding the value represented by the string argument or {@code null} when
* there exists no corresponding {@linkplain LogCategory} object to provided argument value. {@code null} value
* of the string argument is converted to {@code ALL}.
*/
public static final LogCategory toValue(final String name) {
Expand Down
Loading
Loading