Package com.portwise.core.logging
Class CoreLogger
- java.lang.Object
-
- com.portwise.core.logging.CoreLogger
-
- All Implemented Interfaces:
logger.CoreLogger
public class CoreLogger extends java.lang.Object implements logger.CoreLogger
The CoreLogger proxy class. This is the class that should be instantiated by all objects that want's to use the Core logging utility.The CoreLogger proxy class will call the CoreLoggerBroker object, which decides whether to call the local CoreLoggerServer object or a remote CoreLoggerBroker object.
Example:
CoreLogger logger = new CoreLogger(); logger.system.warning("File read error");
Log types and severity levels
There are five different log types:- System log - Logs system events, warnings, and errors. Levels supported are FATAL, WARNING, INFO, DEBUG, and TRACE.
- Audit log - Logs transactions. The only supported levels are WARNING and INFO.
- Billing log - Logs billing transactions. The only supported level is INFO.
- HTTP log - Logs HTTP requests. The only supported level is INFO.
- RADIUS log - Logs RADIUS packet information. The only supported level is INFO.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
CoreLogger.AuditLog
The Audit log type.class
CoreLogger.BillingLog
The Billing log type.class
CoreLogger.EndPointLog
The EPI/EPP log type.class
CoreLogger.EventLog
The Event log type.class
CoreLogger.HTTPLog
The HTTP log type.class
CoreLogger.RADIUSLog
The RADIUS log type.class
CoreLogger.SystemLog
The System log type.
-
Field Summary
Fields Modifier and Type Field Description CoreLogger.AuditLog
audit
A reference to the Audit logger.CoreLogger.BillingLog
billing
A reference to the Billing logger.CoreLogger.EndPointLog
endpoint
A reference to the EPI/EPP logger.CoreLogger.EventLog
event
A reference to the Event logger.CoreLogger.HTTPLog
http
A reference to the HTTP logger.CoreLogger.RADIUSLog
radius
A reference to the RADIUS logger.CoreLogger.SystemLog
system
A reference to the System logger.
-
Constructor Summary
Constructors Constructor Description CoreLogger()
Constructs a new CoreLogger.CoreLogger(int wrappedLevels)
Constructs a new CoreLogger with the number of levels that this class is wrapped.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description logger.CoreLogger.AuditLog
audit()
int
getMaxPacketSize()
boolean
isDebugEnabled()
Returns true if debug is enabled for the system.void
printStackTrace(java.lang.Throwable e)
Prints an exception's stack trace to stderr if debug is enabled.static java.lang.String
replaceArgumentIndexes(java.lang.String message, int amountToAdd)
logger.CoreLogger.SystemLog
system()
-
-
-
Field Detail
-
system
public CoreLogger.SystemLog system
A reference to the System logger.
-
audit
public CoreLogger.AuditLog audit
A reference to the Audit logger.
-
billing
public CoreLogger.BillingLog billing
A reference to the Billing logger.
-
http
public CoreLogger.HTTPLog http
A reference to the HTTP logger.
-
radius
public CoreLogger.RADIUSLog radius
A reference to the RADIUS logger.
-
event
public CoreLogger.EventLog event
A reference to the Event logger. Do not call this directly, use EventLogger instead.
-
endpoint
public CoreLogger.EndPointLog endpoint
A reference to the EPI/EPP logger.
-
-
Constructor Detail
-
CoreLogger
public CoreLogger()
Constructs a new CoreLogger.
-
CoreLogger
public CoreLogger(int wrappedLevels)
Constructs a new CoreLogger with the number of levels that this class is wrapped.Use this constructor if the CoreLogger class is wrapped, for instance if the calling method is a plugin or is in C++ code using JNI to access this Java code.
- Parameters:
wrappedLevels
- The number of levels that this class is wrapped. Set to 0 (default) for normal use, set to 1 if the logger is wrapped 1 level.
-
-
Method Detail
-
isDebugEnabled
public boolean isDebugEnabled()
Returns true if debug is enabled for the system. False is returned otherwise.- Specified by:
isDebugEnabled
in interfacelogger.CoreLogger
- Returns:
- True if debug is enabled, false otherwise.
-
printStackTrace
public void printStackTrace(java.lang.Throwable e)
Prints an exception's stack trace to stderr if debug is enabled.- Specified by:
printStackTrace
in interfacelogger.CoreLogger
- Parameters:
e
- An exception to print.
-
getMaxPacketSize
public int getMaxPacketSize()
- Specified by:
getMaxPacketSize
in interfacelogger.CoreLogger
- Returns:
- the maxLogSize
-
audit
public logger.CoreLogger.AuditLog audit()
- Specified by:
audit
in interfacelogger.CoreLogger
-
system
public logger.CoreLogger.SystemLog system()
- Specified by:
system
in interfacelogger.CoreLogger
-
replaceArgumentIndexes
public static java.lang.String replaceArgumentIndexes(java.lang.String message, int amountToAdd)
-
-