Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved


Chapter 15 Gateway Management Features : Central Logger

Central Logger
Overview
The Central Logger component provides the centralized logging. Each instance of the Core Engine publishes events during its operation. The Central Logger component receives the events from the management bus as messages. The Central Logger stores the messages in the database. The Core Engine instance aggregates events in memory and publishes the messages at configured intervals in order to reduce the disk load during high transaction rates.
The Central Logger communicates with the Core Engine using the following transports:
Pre-requisites
The Central Logger component audit logs the transactions in a database. Make sure to configure and setup a database server for the functionality of the Central Logger component. See Database Setup and Configuration for Central Logger
Database Setup and Configuration for Central Logger
This section explains the steps required to configure the database and the database drivers for the Central Logger component of TIBCO API Exchange Gateway.
Database Location
Instructions in this section assume you are working with a local database for testing purposes. Adapt the instructions if you are working with a remote database. For example, in production environments, you might have to ask a database administrator to create a database and a database user for you.
 
Task A Setup Database Driver
Copy the appropriate JDBC driver jar file to the ASG_HOME/lib/ext/tpcl directory. See the product readme file for the supported versions of database drivers.
For example, database jar file for MySql database is:
      mysql-connector-java-5.1.22-bin.jar
For example, database jar file for Oracle database is:
      ojdbc6.jar
For example, database jar for SQL Server database is:
      sqljdbc4.jar
For example, database jars for DB2 database is:
      db2jcc.jar
      db2jcc_license_cu.jar
Task B Create a Database
Depending on your environment, you might have to ask your database administrator to create a database or use an existing database. For example, for MySql database server, you can create a local database for your testing purposes.
For production environments using Oracle, DB2 and MS SQL Server database server, ask your database administrator to create a database such as asgstat for the Central Logger component of TIBCO API Exchange Gateway.
This section lists the steps to create a database for testing purposes using MySql database server. You must contact your database administrator to use appropriate database for production requirements.
1.
Verify that the MySql database server is running.
2.
   mysql -uroot -p
3.
   Enter password:
4.
   create database asgstat;
5.
Verify that the asgstat database is created.
Refer to http://dev.mysql.com/doc/refman/5.5/en/creating-database.html link for more information.
Task C Create a Database User
For testing purposes, this section explains the steps required to create the database user with appropriate privileges in a database, using the MySql database server.
For production systems using Oracle, SQL Server and DB2 database server, work with your database administrator to create a database user in the appropriate database.
1.
Verify that you are connected to the MySql database server as a root user. If not, type the command:
   mysql -uroot -p
2.
   create user ’asguser’ identified by ’asgpass’;
3.
   grant create,select,insert,update on asgstat.* to asguser@'%'    identified by ’asgpass’;
4.
   flush privileges;
For Oracle Database
Ask your database administrator to create a database user (for example asguser) and grant the connect,resource privileges to this user.
For MS SQL Server Database
Ask your database administrator to create a database user (for example asguser) and grant create,select,insert,update privileges to this user.
For DB2 Database
Ask your database administrator to create a database user (for example asguser) and grant ALL,CONTROL,CONNECT,insert,SELECT privileges to this user.
Task D Setup the Database Schema
This section explains the steps to create the database tables in the database required for the Central Logger component.
For MySql Database
1.
   ASG_HOME/templates/database/mysql
2.
   mysql -D asgstat -uasguser -pasgpass < createAsgTransactions.sql
   mysql -D asgstat -uasguser -pasgpass < createAsgKpis.sql
For Oracle Database
1.
   ASG_HOME/templates/database/oracle
2.
   sqlplus asguser/asgpass@SID @createAsgTransactions.sql
   sqlplus asguser/asgpass@SID @createAsgKpis.sql
For SQL Server Database
1.
   ASG_HOME/templates/database/sqlserver
2.
   isql -Usa -d asgstat -i createAsgTransactions.sql
   isql -Usa -d asgstat -i createAsgKpis.sql
 
For DB2 Database
1.
   ASG_HOME/templates/database/db2
2.
   db2 -tvsf createAsgTransactions.sql
   db2 -tvsf createAsgKpis.sql
Task E Setup the Database Connection Parameters
This section explains the steps required to setup the parameters to connect to the database.
1.
Open the ASG_CONFIG_HOME/asg/asg_cl.properties file for editing.
2.
   tibco.clientVar.CL/Database/Driver=database driver type
   tibco.clientVar.CL/Database/Url=database url
   tibco.clientVar.CL/Database/Username=database user name
   tibco.clientVar.CL/Database/Password=database password
For example, the values are shown for MySql database as follows:
   tibco.clientVar.CL/Database/Driver=com.mysql.jdbc.Driver
   tibco.clientVar.CL/Database/Url=jdbc:mysql://localhost:3306/asg   stat
   tibco.clientVar.CL/Database/Username=asguser
   tibco.clientVar.CL/Database/Password=asgpass
   tibco.clientVar.CL/Database/Schema=asgstat
For example, the values are shown for Oracle database as follows:
   tibco.clientVar.CL/Database/Driver=com.oracle.jdbc.Driver
   tibco.clientVar.CL/Database/Url=jdbc:oracle:thin:@localhost:
   1521:ORCL
   tibco.clientVar.CL/Database/Username=asguser
   tibco.clientVar.CL/Database/Password=asgpass
   tibco.clientVar.CL/Database/Schema=asgstat
 
For example, the values are shown for SQL Server database as follows:
   tibco.clientVar.CL/Database/Driver=com.microsoft.sqlserver.jdbc   .SQLServerDriver
   tibco.clientVar.CL/Database/Url=jdbc:sqlserver://localhost:1433   ;databaseName=asgstat
   tibco.clientVar.CL/Database/Username=asguser
   tibco.clientVar.CL/Database/Password=asgpass
   tibco.clientVar.CL/Database/Schema=dbo
 
For example, the values are shown for DB2 database as follows:
   tibco.clientVar.CL/Database/Driver=com.ibm.db2.jcc.DB2Driver
   tibco.clientVar.CL/Database/Url=jdbc:db2://localhost:50000/asgstat
   tibco.clientVar.CL/Database/Username=asguser
   tibco.clientVar.CL/Database/Password=asgpass
   tibco.clientVar.CL/Database/Schema=asgstat
Runtime Properties For Central Logger
See Runtime Properties of Central Logger for details.
Enable Reporting to the Central Logger
By default, the reporting is not enabled to the Central Logger. Enable the reporting as follows:
1.
Open the ASG_CONFIG_HOME/asg.properties file for editing.
2.
# Turn on or off reporting to CL
tibco.clientVar.ASG/Logging/reportingEnabled=false
3.
To enable the reporting, set the value as: tibco.clientVar.ASG/Logging/reportingEnabled=true
4.
Run the Central Logger
This section explains the steps to run the Central Logger.
1.
2.
Navigate to ASG_HOME/bin directory.
3.
   ./asg-engine -u asg-cl -a ASG_Configuration_Name
 
where ASG_Configuration_Name is the name of the configuration used by the Core Engine.

Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved