Enabling Java Logger in REST Web Services
Enabling Java logger in REST Web Services includes the following steps:
Important Notes
If CT-V is already installed on the Oracle WebLogic Server, remove all the instances of previously installed CT-V.
For details on the usage of the CT-V REST APIs, refer to CipherTrust Vaulted Tokenization REST APIs.
Ensure the following jar files are downloaded and copied to the
/WEB-INF/lib
directory (where the tmrest.war file will be extracted). The/WEB-INF/lib
directory already containscxf
related jar files but with different versions. It is recommended to replace those files with the versions listed below.cxf-core-3.0.12.jar
cxf-rt-security-3.0.12.jar
cxf-rt-frontend-jaxrs-3.0.12.jar
cxf-rt-transports-http-3.0.12.jar
cxf-rt-rs-service-description-3.0.12.jar
Note
We are recommending only these particular versions because they are compatible with guava-33.1.0-jre.jar
.
Updating the JAVA_HOME Files
Follow the steps described here to update the JAVA_HOME files:
Follow the steps described here to update the JAVA_HOME
files:
Copy the following files from the
/SafeNetTokenization/CADP_for_JAVA/lib/ext
directory to the/JAVA_HOME/jre/lib/ext
location. These files are used by the Oracle WebLogic Server:CADP_for_JAVA.properties
CADP_for_JAVA-8.17.0.002.jar
commons-collections4-4.4.jar
commons-lang3-3.14.0.jar
failureaccess-1.0.2.jar
gson-2.10.1.jar
guava-33.1.0-jre.jar
log4j-api-2.23.1.jar
log4j-core-2.23.1.jar
Update the following parameters of the CADP_for_JAVA.properties file:
NAE_IP.1: <IP address of the Key Manager>
NAE_PORT: <NAE Port>
Log_File: <Path of the log file with required permissions>
LoggingUtility=JavaLogger
Configuring CT-V Related Files
Follow the steps described here to configure CT-V specific files:
Create a folder named myconfig at
<wl_home>
location. Here<wl_home>
is the Oracle WebLogic home directory, for example,C:/Oracle/Middleware/Oracle_Home
.Copy the following files from the
/SafeNetTokenization/Tokenization/lib/ext
directory to the<wl_home>/myconfig
location:SafeNetToken.properties
SfntDbp.properties
Update the following parameters of the
SafeNetToken.properties
file:HostName: <IP address of the database>
Port Number: <Port number of the database server>
DatabaseType: <Type of the database to be used; for example, Oracle>
DatabaseName: <Database instance>
Open the
setDomainEnv
file located at<wl_home>/user_projects/domains/<Your_domain_name>/bin
and update"set JAVA_PROPERTIES=-Dwls.home=%WLS_HOME% -Dweblogic.home=%WLS_HOME%" to "set JAVA_PROPERTIES=-Dwls.home=%WLS_HOME% -Dweblogic.home=%WLS_HOME% -Dcom.safenet.SfntDbp_Properties_Conf_Filename=C:/Oracle/Middleware/Oracle_Home/myconfig/SfntDbp.properties -Dcom.safenet.SafeNetToken_Properties_Conf_Filename=C:/Oracle/Middleware/Oracle_Home/myconfig/SafeNetToken.properties"
Recreating the tmrest.war File
Follow the steps described here to recreate the tmrest.war
file:
Extract the existing
tmrest.war
file fromSafeNetTokenization\Tokenization\restfulService
to any user location using the following command:jar -xvf tmrest.war
The following screen displays the extracted location of the
tmrest.war
file:Note
The JDBC drivers for the supported databases are no longer part of the CT-V package. Download the JDBC drivers compatible with your database and copy them to the
../WEB-INF/lib
directory. Refer to the below table for the download links:Database Driver Name Download Link MySQL mysql-connector-j-x.x.x.jar
MySQL website Informix jdbc-x.x.x.x.jar
Maven repository Oracle ojdbc8-x.x.x.x.x.jar
Maven repository SQL Server mssql-jdbc-x.x.x.jre8.jar
Maven repository Copy the following files from the
/SafeNetTokenization/Tokenization/lib/ext
directory to the../WEB-INF/lib
folder extracted in the preceding step.bson-5.1.0.jar MultiSite.properties SilentInstallation.properties c3p0-0.10.1.jar detokenization.properties TVMInformix.jar oraclepki-23.4.0.24.05.jar TVMMySQL.jar jtds-1.3.1.jar osdt_cert-21.14.0.0.jar TVMOracle.jar masking.properties osdt_core-21.14.0.0.jar TVMSQLServer.jar mchange-commons-java-0.3.1.jar SafeNetTokenService-8.13.2.000.jar unicode.properties migration.properties SafeNetTVM.jar Navigate to the extracted location and create the
tmrest.war
file using the following command:jar –cvf tmrest.war *
Deploy the
tmrest.war
file on the Oracle WebLogic Server.Note
For details on the usage of the CT-V REST APIs, refer to CipherTrust Vaulted Tokenization REST APIs.
Log Level Mapping with Java Logger
Log_Level | Java Logger |
---|---|
ERROR | SEVERE |
WARN | WARNING |
INFO | INFO |
DEBUG | ALL |
NONE | No logs will be generated |
Log Rotation Support in Java Logger
Java logger supports Log_Rotation
by Size
and Daily
, whichever occurs first. Consider if Size
is set to 1 MB and Daily
is set to 24 hours. Now, if the size of the log file exceeds 1 MB before 24 hours, Log_Rotation
will be by Size
. But if the size of the log file does not exceed 1 MB after 24 hours, Log_Rotation
will be by Daily
.
Note
Java logger does not support the values: Weekly
and Monthly
.