Fact
PhenixID Provisioning
Situation
The logging API consists of a Java interface, where system log messages and/or audit messages can be redirected to, instead of the standard file logging.
Solution
- A class that implements the interface se.nordicedge.NELoggingInterface should be created.
- The class file must be packaged in a jar and be placed in the ext directory located under the Provisioning installation directory.
- Start the Provisioning Configurator and click Yes in the Alert Window. This makes Provisioning load the new class file.
- Add the configuration using either the Configurator or directly in the file config.aam:
In the Configurator, go to General and then Log Settings. Check Use External Logging and enter your external logger class name.
Directly in config.aam, add the parameter, ExternalLoggerClassName=LoggerClassName - Restart Provisioning service to activate the changes.
Description of the Lifecycle and Log Methods in the Interface
The following methods must be overridden:
public Boolean initialize();
Initialize the logging functions.
This method is called from Provisioning when Provisioning starts
Return: TRUE if the initialization was successful
public void close();
The Provisioning will shutdown.
Perform cleanup if necessary, e.g. close database connections.
public Boolean getUseOnlyThisLogger();
If this extension should be the only logging source or if Provisioning will continue to use LOG4J
after this extension has been called.
Return: TRUE if this extension will be used exclusively
public void debug(String msg);
Log a debug message.
msg: The message to be logged.
public void debug(String msg, Throwable e);
Log a debug message.
msg: The message to be logged.
e: The throwable object
This method overloads the debug(String msg) method: Used when Provisioning encounters a runtime Exception.
public void info(String msg);
Log an info message.
msg: The message to be logged.
public void info(String msg, Throwable e);
Log an info message.
msg: The message to be logged.
e: The throwable object.
public void warn(String msg);
Log a warn message.
msg: The message to be logged.
public void warn(String msg, Throwable e);
Log a warn message.
msg: The message to be logged.
e: The throwable object.
public void error(String msg);
Log an error message.
msg: The message to be logged.
public void error(String msg, Throwable e);
Log an error message.
msg: The message to be logged.
e: The throwable object.
public void fatal(String msg);
Log a fatal message.
msg: The message to be logged.
public void fatal(String msg, Throwable e);
Log a fatal message.
msg: The message to be logged.
e: The throwable object
Important Note
If calling the default logger for Provisioning (NELogger) from within your extension logger you must get the logger instance from the getLogger() method of the NELogger class.
Example:
se.nordicedge.NELogger.getLogger().error(“You error log message”);
DISCLAIMER
Information provided in this document is for your information only. PhenixID makes no explicit or implied claims to the validity of this information. Any trademarks referenced in this document are the property of their respective owners.The origin of this information may be internal or external to PhenixID. PhenixID makes all reasonable efforts to verify this information.
PhenixID - support.phenixid.se