Class ILog
The Loggers class handles the available and registered loggers on a thread or thread group basis, or an instance of a class that can hold the particular instance data.
Optional arguments are placed in order where the formatting string contains open/close braces as "{}". If there are missing braces, each additional argument is placed on a numbered line below, indented with " - ", resulting in e.g. " - 1 = argument-as-string".
The following arguments are converted using "deep-toString" meaning their contents and subcontents are deep-toString'eg if possible, otherwise just as "toString()".
- null: "null".
- Array of primitives: the entire array is expanded.
- com.iizix.prop.StringMapProp or java.util.Map: lists all the contents on new lines as " - key = value".
- Throwable: expanded throwable with stack trace, including potential ignored exception and cause.
- Author:
- Christopher Mindus
- Field SummaryFieldsModifier and TypeFieldDescription- static final intThe CONFIG (=4) log event.- static final intThe FINE (=5) log event.- static final intThe FINER (=6) log event.- static final intThe FINEST (=7) log event.- static final intThe INFO (=3) log event.- static final intThe SEVERE (=1) log event.- static final intThe WARNING (=2) log event.
- Constructor SummaryConstructors
- Method SummaryModifier and TypeMethodDescription- voidOutputs a config log event.- voidOutputs a config log event.- voidOutputs a config log event.- voidOutputs a config log event.- static voidOutputs a config log event.- static voidOutputs a config log event.- static voidOutputs a config log event.- static voidOutputs a config log event.- static voidOutputs a config log event.- static voidOutputs a config log event.- static voidOutputs a config log event.- static voidOutputs a config log event.- static voidCall to indicate that a method is entered.- static voidCall to indicate that a method is entered.- static voidCall to indicate that a method is entered.- voidCall to indicate that a method is entered.- static voidCall to indicate that a method is entered.- static voidCall to indicate that a method is entered.- void- exiting()Call to indicate that a method is exited.- static voidCall to indicate that a method is exited.- static voidCall to indicate that a method is exited with a return value.- static voidCall to indicate that a method is exited.- static voidCall to indicate that a method is exited with a return value.- voidOutputs a fine log event.- voidOutputs a fine log event.- voidOutputs a fine log event.- voidOutputs a fine log event.- static voidOutputs a fine log event.- static voidOutputs a fine log event.- static voidOutputs a fine log event.- static voidOutputs a fine log event.- static voidOutputs a fine log event.- static voidOutputs a fine log event.- static voidOutputs a fine log event.- static voidOutputs a fine log event.- voidOutputs a finer log event.- voidOutputs a finer log event.- voidOutputs a finer log event.- voidOutputs a finer log event.- static voidOutputs a finer log event.- static voidOutputs a finer log event.- static voidOutputs a finer log event.- static voidOutputs a finer log event.- static voidOutputs a finer log event.- static voidOutputs a finer log event.- static voidOutputs a finer log event.- static voidOutputs a finer log event.- voidOutputs a finest log event.- voidOutputs a finest log event.- voidOutputs a finest log event.- voidOutputs a finest log event.- static voidOutputs a finest log event.- static voidOutputs a finest log event.- static voidOutputs a finest log event.- static voidOutputs a finest log event.- static voidOutputs a finest log event.- static voidOutputs a finest log event.- static voidOutputs a finest log event.- static voidOutputs a finest log event.- static StringFormats an array of parameters.- static intGets the currently configured log level.- static String- getShortenedClassName- (Class<?> clazz) Gets the shortened name of a class.- static StringGets the shortened name of a class.- voidOutputs an info log event.- voidOutputs an info log event.- voidOutputs an info log event.- voidOutputs an info log event.- static voidOutputs an info log event.- static voidOutputs an info log event.- static voidOutputs an info log event.- static voidOutputs an info log event.- static voidOutputs an info log event.- static voidOutputs an info log event.- static voidOutputs an info log event.- static voidOutputs an info log event.- static boolean- isLogged- (int level) Checks if the event would normally be logged.- static voidLogs an event.- static voidLogs an event.- static voidLogs an event.- static voidLogs an event.- static voidLogs an event.- static voidLogs an event.- static voidLogs an event.- static int- mapJSLogLevelToJava- (int level) Maps the JavaScript log levels [0='DEBUG',1='INFO',2='WARN',3='ERROR',4='FATAL',5='NONE',6='ALWAYS'] to Java.- static boolean- setLogLevel- (int newLevel) Changes the logger log level.- voidOutputs a severe log event.- voidOutputs a severe log event.- voidOutputs a severe log event.- voidOutputs a severe log event.- static voidOutputs a severe log event.- static voidOutputs a severe log event.- static voidOutputs a severe log event.- static voidOutputs a severe log event.- static voidOutputs a severe log event.- static voidOutputs a severe log event.- static voidOutputs a severe log event.- static voidOutputs a severe log event.- voidOutputs a warning log event.- voidOutputs a warning log event.- voidOutputs a warning log event.- voidOutputs a warning log event.- static voidOutputs a warning log event.- static voidOutputs a warning log event.- static voidOutputs a warning log event.- static voidOutputs a warning log event.- static voidOutputs a warning log event.- static voidOutputs a warning log event.- static voidOutputs a warning log event.- static voidOutputs a warning log event.
- Field Details- SEVEREpublic static final int SEVEREThe SEVERE (=1) log event.- See Also:
 
- WARNINGpublic static final int WARNINGThe WARNING (=2) log event.- See Also:
 
- INFOpublic static final int INFOThe INFO (=3) log event.- See Also:
 
- CONFIGpublic static final int CONFIGThe CONFIG (=4) log event.- See Also:
 
- FINEpublic static final int FINEThe FINE (=5) log event.- See Also:
 
- FINERpublic static final int FINERThe FINER (=6) log event.- See Also:
 
- FINESTpublic static final int FINESTThe FINEST (=7) log event.- See Also:
 
 
- Constructor Details- ILogCreates an instance of the logger for an originator.- Parameters:
- originator- originating class
 
- ILogCreates an instance of a named logger.- Parameters:
- name- The name of the logger.
 
 
- Method Details- mapJSLogLevelToJavapublic static int mapJSLogLevelToJava- (int level) Maps the JavaScript log levels [0='DEBUG',1='INFO',2='WARN',3='ERROR',4='FATAL',5='NONE',6='ALWAYS'] to Java. NONE and "n/a" maps to FINE.- Parameters:
- level- The JavaScript log level.
- Returns:
- The Java log level.
 
- getLogLevelpublic static int getLogLevel()Gets the currently configured log level.- Returns:
- The current log level (1-7) SEVERE-FINEST.
 
- setLogLevelpublic static boolean setLogLevel- (int newLevel) Changes the logger log level.- Parameters:
- newLevel- the new log level (1-7) SEVERE-FINEST.
- Returns:
- true if any setting changed, false if same values were present.
 
- isLoggedpublic static boolean isLogged- (int level) Checks if the event would normally be logged. This call is typically used to avoid multiple log outputs one after another or if the message to log is very complex to compute in terms of String concatenation and building.- The return value might be true but the event still not logged later on. This might be the case if some special filtering is applied in order to see just the log of e.g. a particular client, application or thread. - Parameters:
- level- The log level.
- Returns:
- true if the event is normally logged, false otherwise.
 
- getShortenedClassNameGets the shortened name of a class.- Parameters:
- clazz- The class, or- nullfor "system".
- Returns:
- The short form of the class name, or systemifclazzisnull.
- See Also:
 
- getShortenedClassNameGets the shortened name of a class.- The following list shows the names beginning with a prefix and what the replacement is: - "com.iizix." -> "ci."
- "com.iizix.prop." -> "cip."
- "com.iizix.server." -> "cis."
- "com.iizigo." -> "cI."
- "org.eclipse.jetty." -> "oej."
- "org.eclipse.jetty.server." -> "oejs."
 - Parameters:
- cn- The class name.
- Returns:
- The short form of the class name (if any short for exists), or "system" if the cnparameter wasnull.
 
- enteringCall to indicate that a method is entered. If log level is set to- FINERor less, this will be logged. The method name is fetched implicitly. However, this assumes that the containing class has the following static member:- private static ILog log = new ILog(ClassName.class);- Parameters:
- params- Optional parameters
 
- exitingpublic void exiting()Call to indicate that a method is exited. If log level is set to- FINERor less, this will be logged.- The method name is fetched implicitly from the call stack.. However, this assumes that the containing class has the following static member: - private static ILog log = new ILog(ClassName.class);
- enteringCall to indicate that a method is entered. If log level is set to- FINERor less, this will be logged.- Parameters:
- originator- The originator class
- method- The method name
 
- enteringCall to indicate that a method is entered. If log level is set to- FINERor less, this will be logged.- The - originatorparameter will be used to look up the class name from the instance.- Parameters:
- originator- The originator instance
- method- The method name
 
- enteringCall to indicate that a method is entered. If log level is set to- FINERor less, this will be logged.- The - originatorparameter will be used to look up the class name from the instance.- Parameters:
- originator- The originator instance
- method- The method name
 
- enteringCall to indicate that a method is entered. If log level is set to- FINERor less, this will be logged.- Parameters:
- originator- the containing class
- method- explicit method name
- param1- the fist parameter
 
- enteringCall to indicate that a method is entered. If log level is set to- FINERor less, this will be logged.- Parameters:
- originator- the containing class
- method- explicit method name
- params- list of parameters
 
- exitingCall to indicate that a method is exited. If log level is set to- FINERor less, this will be logged.- Parameters:
- originator- the containing class
- method- explicit method name
 
- exitingCall to indicate that a method is exited. If log level is set to- FINERor less, this will be logged.- Parameters:
- originator- the origin
- method- explicit method name
 
- exitingCall to indicate that a method is exited with a return value. If log level is set to- FINERor less, this will be logged.- Parameters:
- originator- the containing class
- method- explicit method name
- result- the result
 
- exitingCall to indicate that a method is exited with a return value. If log level is set to- FINERor less, this will be logged.- Parameters:
- originator- the origin
- method- explicit method name
- result- the result
 
- formatFormats an array of parameters.- Parameters:
- params- List of parameters, or- nullfor none.
- Returns:
- The formatted string of parameters using Utilities.toString(Object).
 
- FINESTOutputs a finest log event.- Parameters:
- msg- message to log
 
- finestOutputs a finest log event.- Parameters:
- msg- message to log
 
- FINESTOutputs a finest log event.- Parameters:
- msg- message to log
- param1- first parameter
 
- finestOutputs a finest log event.- Parameters:
- msg- message to log
- param1- first parameter
 
- FINESTOutputs a finest log event.- Parameters:
- msg- message to log
- params- parameters
 
- finestOutputs a finest log event.- Parameters:
- msg- message to log
- params- parameters
 
- FINESTOutputs a finest log event.- Parameters:
- msg- message to log
- thrown- thrown exception
 
- finestOutputs a finest log event.- Parameters:
- msg- message to log
- thrown- thrown exception
 
- FINESTOutputs a finest log event.- Parameters:
- originator- originating class
- msg- message
 
- FINESTOutputs a finest log event.- Parameters:
- originator- originating class
- msg- message
- param1- first parameter
 
- FINESTOutputs a finest log event.- Parameters:
- originator- originating class
- msg- message
- params- parameters
 
- FINESTOutputs a finest log event.- Parameters:
- originator- originating class
- msg- message
- thrown- thrown Exception
 
- FINEROutputs a finer log event.- Parameters:
- msg- message to log
 
- finerOutputs a finer log event.- Parameters:
- msg- message to log
 
- FINEROutputs a finer log event.- Parameters:
- msg- message to log
- param1- first parameter
 
- finerOutputs a finer log event.- Parameters:
- msg- message to log
- param1- first parameter
 
- FINEROutputs a finer log event.- Parameters:
- msg- message to log
- params- parameters
 
- finerOutputs a finer log event.- Parameters:
- msg- message to log
- params- parameters
 
- FINEROutputs a finer log event.- Parameters:
- msg- message to log
- thrown- thrown exception
 
- finerOutputs a finer log event.- Parameters:
- msg- message to log
- thrown- thrown exception
 
- FINEROutputs a finer log event.- Parameters:
- originator- originating class
- msg- message
 
- FINEROutputs a finer log event.- Parameters:
- originator- originating class
- msg- message
- param1- first parameter
 
- FINEROutputs a finer log event.- Parameters:
- originator- originating class
- msg- message
- params- parameters
 
- FINEROutputs a finer log event.- Parameters:
- originator- originating class
- msg- message
- thrown- thrown Exception
 
- FINEOutputs a fine log event.- Parameters:
- msg- message to log
 
- fineOutputs a fine log event.- Parameters:
- msg- message to log
 
- FINEOutputs a fine log event.- Parameters:
- msg- message to log
- param1- first parameter
 
- fineOutputs a fine log event.- Parameters:
- msg- message to log
- param1- first parameter
 
- FINEOutputs a fine log event.- Parameters:
- msg- message to log
- params- parameters
 
- fineOutputs a fine log event.- Parameters:
- msg- message to log
- params- parameters
 
- FINEOutputs a fine log event.- Parameters:
- msg- message to log
- thrown- thrown exception
 
- fineOutputs a fine log event.- Parameters:
- msg- message to log
- thrown- thrown exception
 
- FINEOutputs a fine log event.- Parameters:
- originator- originating class
- msg- message
 
- FINEOutputs a fine log event.- Parameters:
- originator- originating class
- msg- message
- param1- first parameter
 
- FINEOutputs a fine log event.- Parameters:
- originator- originating class
- msg- message
- params- parameters
 
- FINEOutputs a fine log event.- Parameters:
- originator- originating class
- msg- message
- thrown- thrown Exception
 
- CONFIGOutputs a config log event.- Parameters:
- msg- message to log
 
- configOutputs a config log event.- Parameters:
- msg- message to log
 
- CONFIGOutputs a config log event.- Parameters:
- msg- message to log
- param1- first parameter
 
- configOutputs a config log event.- Parameters:
- msg- message to log
- param1- first parameter
 
- CONFIGOutputs a config log event.- Parameters:
- msg- message to log
- params- parameters
 
- configOutputs a config log event.- Parameters:
- msg- message to log
- params- parameters
 
- CONFIGOutputs a config log event.- Parameters:
- msg- message to log
- thrown- thrown exception
 
- configOutputs a config log event.- Parameters:
- msg- message to log
- thrown- thrown exception
 
- CONFIGOutputs a config log event.- Parameters:
- originator- originating class
- msg- message
 
- CONFIGOutputs a config log event.- Parameters:
- originator- originating class
- msg- message
- param1- first parameter
 
- CONFIGOutputs a config log event.- Parameters:
- originator- originating class
- msg- message
- params- parameters
 
- CONFIGOutputs a config log event.- Parameters:
- originator- originating class
- msg- message
- thrown- thrown Exception
 
- INFOOutputs an info log event.- Parameters:
- msg- message to log
 
- infoOutputs an info log event.- Parameters:
- msg- message to log
 
- INFOOutputs an info log event.- Parameters:
- msg- message to log
- param1- first parameter
 
- infoOutputs an info log event.- Parameters:
- msg- message to log
- param1- first parameter
 
- INFOOutputs an info log event.- Parameters:
- msg- message to log
- params- parameters
 
- infoOutputs an info log event.- Parameters:
- msg- message to log
- params- parameters
 
- INFOOutputs an info log event.- Parameters:
- msg- message to log
- thrown- thrown exception
 
- infoOutputs an info log event.- Parameters:
- msg- message to log
- thrown- thrown exception
 
- INFOOutputs an info log event.- Parameters:
- originator- originating class
- msg- message
 
- INFOOutputs an info log event.- Parameters:
- originator- originating class
- msg- message
- param1- first parameter
 
- INFOOutputs an info log event.- Parameters:
- originator- originating class
- msg- message
- params- parameters
 
- INFOOutputs an info log event.- Parameters:
- originator- originating class
- msg- message
- thrown- thrown Exception
 
- WARNINGOutputs a warning log event.- Parameters:
- msg- message to log
 
- warningOutputs a warning log event.- Parameters:
- msg- message to log
 
- WARNINGOutputs a warning log event.- Parameters:
- msg- message to log
- param1- first parameter
 
- warningOutputs a warning log event.- Parameters:
- msg- message to log
- param1- first parameter
 
- WARNINGOutputs a warning log event.- Parameters:
- msg- message to log
- params- parameters
 
- warningOutputs a warning log event.- Parameters:
- msg- message to log
- params- parameters
 
- WARNINGOutputs a warning log event.- Parameters:
- msg- message to log
- thrown- thrown exception
 
- warningOutputs a warning log event.- Parameters:
- msg- message to log
- thrown- thrown exception
 
- WARNINGOutputs a warning log event.- Parameters:
- originator- originating class
- msg- message
 
- WARNINGOutputs a warning log event.- Parameters:
- originator- originating class
- msg- message
- param1- first parameter
 
- WARNINGOutputs a warning log event.- Parameters:
- originator- originating class
- msg- message
- params- parameters
 
- WARNINGOutputs a warning log event.- Parameters:
- originator- originating class
- msg- message
- thrown- thrown Exception
 
- SEVEREOutputs a severe log event.- Parameters:
- msg- message to log
 
- severeOutputs a severe log event.- Parameters:
- msg- message to log
 
- SEVEREOutputs a severe log event.- Parameters:
- msg- message to log
- param1- first parameter
 
- severeOutputs a severe log event.- Parameters:
- msg- message to log
- param1- first parameter
 
- SEVEREOutputs a severe log event.- Parameters:
- msg- message to log
- params- parameters
 
- severeOutputs a severe log event.- Parameters:
- msg- message to log
- params- parameters
 
- SEVEREOutputs a severe log event.- Parameters:
- msg- message to log
- thrown- thrown exception
 
- severeOutputs a severe log event.- Parameters:
- msg- message to log
- thrown- thrown exception
 
- SEVEREOutputs a severe log event.- Parameters:
- originator- originating class
- msg- message
 
- SEVEREOutputs a severe log event.- Parameters:
- originator- originating class
- msg- message
- param1- first parameter
 
- SEVEREOutputs a severe log event.- Parameters:
- originator- originating class
- msg- message
- params- parameters
 
- SEVEREOutputs a severe log event.- Parameters:
- originator- originating class
- msg- message
- thrown- thrown Exception
 
- logLogs an event.- Parameters:
- level- The log level.
- msg- The message.
 
- logLogs an event.- Parameters:
- level- The log level.
- clazz- Event originates from class.
- msg- The message.
 
- logLogs an event.- Parameters:
- level- The log level.
- originator- Event originates from class or logger name.
- msg- The message.
 
- logLogs an event.- Parameters:
- level- The log level.
- clazz- Event originates from class.
- msg- The message.
- param1- The single parameter.
 
- logLogs an event.- Parameters:
- level- The log level.
- originator- Event originates from class or logger name.
- msg- The message.
- param1- The single parameter.
 
- logLogs an event.- Parameters:
- level- The log level.
- clazz- Event originates from class.
- msg- The message.
- params- The list of parameters.
 
- logLogs an event.- Parameters:
- level- The log level.
- originator- Event originates from class or logger name.
- msg- The message.
- params- The list of parameters.