Package org.bgerp.util
Class Log
java.lang.Object
org.bgerp.util.Log
- Direct Known Subclasses:
Log
Logging wrapper around Log4j version 1 with additional functions from version 2.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLog(org.apache.log4j.Logger logger) Make private later, temporary protected for backward compatible inherited class. -
Method Summary
Modifier and TypeMethodDescriptionvoidExecuteslog(Priority, String, Object...)withLevel.DEBUGvoidExecuteslog(Priority, String, Object...)withLevel.ERROR.voidLogs error message and stack trace.voidLogs error message fromeand stack trace.static StringFormats message using pattern with substitutions.static LoggetLog()UsingStackLocatorUtilgets the caller's object and logger for its class.static LogClass connected logger.voidExecuteslog(Priority, String, Object...)withLevel.INFO.booleanfinal voidWraps function toLogger.voidExecuteslog(Priority, String, Object...)withLevel.TRACEvoidExecuteslog(Priority, String, Object...)withLevel.WARN.voidSpecial warn call for deprecation messages.voidwarndClass(Class<?> deprecatedClass, Class<?> actualClass) Deprecation warning for a created class instancevoidDeprecation warning for a JSP callvoidwarndMethod(String deprecatedName) Deprecation warning for a called methodvoidwarndMethod(String deprecatedName, String actualName) Deprecation warning for a called method
-
Field Details
-
MSG_DEPRECATED_METHOD_WAS_CALLED
- See Also:
-
MSG_WS_CREATE_NEW_INSTANCE_INSTEAD
- See Also:
-
-
Constructor Details
-
Log
protected Log(org.apache.log4j.Logger logger) Make private later, temporary protected for backward compatible inherited class.
-
-
Method Details
-
getLog
Class connected logger.- Parameters:
clazz- the class.- Returns:
- logger configured for
clazz
-
getLog
UsingStackLocatorUtilgets the caller's object and logger for its class.- Returns:
- logger configured for the caller object's class.
-
format
Formats message using pattern with substitutions.- Parameters:
message- format usingFormattedMessage, supports both{}and%ssubstitutions.args- parameters for replacements inmessage.- Returns:
-
trace
Executeslog(Priority, String, Object...)withLevel.TRACE -
debug
Executeslog(Priority, String, Object...)withLevel.DEBUG -
isDebugEnabled
public boolean isDebugEnabled()- Returns:
- is
Level.DEBUGenabled.
-
info
Executeslog(Priority, String, Object...)withLevel.INFO. -
warn
Executeslog(Priority, String, Object...)withLevel.WARN. -
warnd
Special warn call for deprecation messages.- Parameters:
message- the message text pattern.args-
-
warndMethod
Deprecation warning for a called method- Parameters:
deprecatedName- the deprecated method nameactualName- the actual method name ornullif no such exists
-
warndMethod
Deprecation warning for a called method- Parameters:
deprecatedName- the deprecated method name
-
warndClass
Deprecation warning for a created class instance- Parameters:
deprecatedClass- the deprecated classactualClass- the actual ones
-
warndJsp
Deprecation warning for a JSP call- Parameters:
deprecatedName- the deprecated call stringactualName- the actual call string
-
error
Executeslog(Priority, String, Object...)withLevel.ERROR. -
error
Logs error message fromeand stack trace.- Parameters:
e- the exception.
-
error
Logs error message and stack trace.- Parameters:
message- message text.e- exception.
-
log
Wraps function toLogger.- Parameters:
level-message-
-